1.0.0 • Published 6 years ago

@liptons/zipper v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

Zipper

Super fast dynamic object serialization.

const Zipper = require('Zipper') // bloop

const DataPoint = {
   foo: 69,
   bar: 420,
   baz: 666
}

// Describe a DataPoint object to a new Zipper instance.
// A Zipper instance will dynamically generate a pair of optimized functions for 
// serializing (zip) and deserializing (unzip) javascript objects based on these keys.

const { zip, unzip } = new Zipper([
   'baz',
   'bar',
   'foo'
])


var zipped = zip(DataPoint) // [666, 420, 96]
var unzipped = unzip(zipped) // {foo: 96, bar: 420, baz: 666}