Function nativeScriptToJson

Converts a NativeScript into its json representation.