key-compressor
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

key-compressor

A tiny, dependency-free tool that can compress/decompress property keys to save database storage/bandwidth costs. Works with nested objects and arrays too!

import KeyCompressor from 'key-compressor'
// const KeyCompressor = require('key-compressor').default

const compressor = new KeyCompressor({
  firstName: 'fn',
  lastName: 'ln',
  age: 'a'
})

const tiny = compressor.compress({ firstName: 'Zach', age: 28 }) 
//  { fn: 'Zach', a: 28 }

const big = compressor.decompress(tiny) 
// { firstName: 'Zach', age: 28 }

Readme

Keywords

none

Package Sidebar

Install

npm i key-compressor

Weekly Downloads

2

Version

1.0.4

License

MIT

Unpacked Size

3.01 kB

Total Files

4

Last publish

Collaborators

  • zholmes1