An open API service indexing awesome lists of open source software.

https://github.com/zacanger/shrink-string

Tiny string compression module for Node.
https://github.com/zacanger/shrink-string

compress compression shrink string

Last synced: about 1 month ago
JSON representation

Tiny string compression module for Node.

Awesome Lists containing this project

README

        

# shrink-string

Tiny string compression module for Node.

[Donate](https://ko-fi.com/zacanger)

--------

## Installation

`npm i shrink-string`

## Usage

```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)
}
```

Thanks to [MrlolDev](https://github.com/MrlolDev) for adding TypeScript support.

[LICENSE](./LICENSE.md)