node-gzip
Gzip and ungzip in Node.js
Tiny and easy to use wrapper around zlib.gzip and zlib.gunzip to support promises.
const compressed = await ;
Install
npm install node-gzip --save
Examples
With Promises
const gzip ungzip = ; ;
With async / await
const gzip ungzip = ; const compressed = await ; const decompressed = await ; console; //Hello World
Options
Pass options just like with Zlib. See all options.
await ;
Description
gzip(input[,options])
- input:
Buffer | TypedArray | DataView | ArrayBuffer | string
- returns:
Buffer
ungzip(input[,options])
- input:
Buffer | TypedArray | DataView | ArrayBuffer | string
- returns:
Buffer
Use toString()
after ungzip
to convert the Buffer into a string.
Supports Node.js version 0.12 and higher.
License
node-gzip is MIT licensed.