zacanger / shrink-string

Tiny string compression module for Node.

Home Page:http://npm.im/shrink-string

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

shrink-string

Tiny string compression module for Node.

Donate


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

About

Tiny string compression module for Node.

http://npm.im/shrink-string

License:MIT License


Languages

Language:JavaScript 88.7%Language:TypeScript 11.3%