compress-object
💎 when objects become too large, let's turn them into something smaller
Installation
npm install compress-object --save
Usage
a AMD version of this is available at dist/compress-object.js
const Compress = ;const flattened = 'Gabriel J. Csapo' 22 'Male' 'PayPal' 'Software Engineer';const compressor = name: '' age: 0 gender: '' friends: job: employer: '' position: '' ; const object = compressor;const flattenAgain = compressor;
What does it do?
compress-object
aims to remove the need for keys in JSON, by having a map to and from the flattened structure
Turning an array of 1000 complex objects (objects that have nsted objects and nested arrays) (373ms)
size before | size after |
---|---|
315.04 KB | 231.06 KB |