npm.io
4.0.0 • Published 11 months ago

shrink-string

Licence
MIT
Version
4.0.0
Deps
0
Size
11 kB
Vulns
0
Weekly
0
Stars
10

shrink-string

Tiny string compression module for Node.


Installation

npm i shrink-string

Usage

const { compress, decompress } = require('shrink-string')

// `compress` takes a unicode string and returns a base64 string
// `decompress` takes that base64 string and returns the original unicode string

const thing = async (s = '') => {
  const shrunk = await compress(s)
  const expanded = await decompress(shrunk)
  assert(s === expanded)
}

Thanks to MrlolDev for adding TypeScript support.

LICENSE

Keywords