Skip to content

A tiny, dependency-free tool that can compress/decompress property keys to save database storage/bandwidth costs

Notifications You must be signed in to change notification settings

zholmes1/key-compressor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 }

About

A tiny, dependency-free tool that can compress/decompress property keys to save database storage/bandwidth costs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published