shrink-string-typescript
Version:
Tiny string compression module for Node.
29 lines (18 loc) • 813 B
Markdown
Tiny string compression module for Node.
[](https://paypal.me/zacanger) [](https://www.patreon.com/zacanger) [](https://ko-fi.com/U7U2110VB)
--------
`npm i shrink-string`
```javascript
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)
}
```
[](./LICENSE.md)