cold-storage

Full serialization of JS objects

cold-storage

Full serialization/deserialization for JS objects.

Install: npm install cold-storage

// serialize returns a Buffer
// deserialize reads a Buffer
// clone is chaining the two
const { serialize, deserialize, clone } = require('cold-storage');

clone({ a: 1, b: 2 }) // => { a: 1, b: 2 }
clone({ deep: { value: null } }) // works with deep objects

clone({}) instanceof Object // false, even the prototypes are cloned

Breaking deserialization of existing serialized data is considered semver-major.

License

MIT

HomePage

https://github.com/addaleax/cold-storage#readme

Repository

git+https://github.com/addaleax/cold-storage.git