gss.mod.js

command
v0.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

gss.mod.js is the package for go-simple-serializer (GSS) that is built as a JavaScript module. In modern JavaScript, the module can be imported using destructuring assignment. The functions are defined in the Exports variable in the gssjs package.

Usage

// Below is a simple set of examples of how to use this package in a JavaScript application.

// load functions into current scope
const { serialize, deserialize, convert, formats } = require('./dist/gss.global.min.js);

// Serialize an object to a string.
// Returns an object, which can be destructured to the formatted string and error as a string.
// If there is no error, then err will be null.
var { str, err } = serialize(object, format, options);

// Deserialize a formatted string to an object.
// Returns an object, which can be destructured to the object and error as a string.
// If there is no error, then err will be null.
var { obj, err } = deserialize(str, format, options);

// Convert a formatted string to a new format.
// Returns an object, which can be destructured to the string and error as a string.
// If there is no error, then err will be null.
var { str, err } = convert(str, inputFormat, ouputFormat, inputOptions, outputOptions);

References

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL