em-serializer
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Serializer

securely serializes a particular class of objects.

these objects keep their methods.

Usage

1. construct a serializer object

mySerializer = new Serializer<MyClass>(new MyClass());

note: for the time being, it is required to include a prototype object as constructor parameter

2. serialize Objects

myObjectString : string = mySerializer.serialize(myObject : MyClass)

3. deserialize Objects

myNewObject : MyClass = mySerializer.deserialize(myObjectString : string)

4. use myNewObject as you would myObject;

Assuming MyClass has the method .myMethod(), you can now call myNewObject.myMethod() and expect the same results.

Limitations

You cannot transmit lambdas.

See also

https://github.com/emdiet/Serializer.js

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    1
  • 1.0.0
    0

Package Sidebar

Install

npm i em-serializer

Weekly Downloads

1

Version

1.0.1

License

GPL-3.0

Unpacked Size

10.6 kB

Total Files

9

Last publish

Collaborators

  • emdiet