base64zip
This module encapsulates gzip compression and base64 encoding support.
中文说明
Install
$ npm i base64zip --save
Usage
'use strict'; const gzip ungzip = ; let zipped = await ;let unzipped = await ;
More usage can be found in test.js
gzip(data, options)
- data can be a string or any serializable object
- In addition to the options that come with Node.js, options also support the extended option base64.
- The buffer is returned by default, but the base64 string is returned when options.base64 is true.
ungzip(data, options)
- data should be a valid buffer or base64 string
- In addition to the options that come with Node.js, options also support the extended option parse.
- The buffer is returned by default, but the result of JSON.parse is returned when options.parse is true.
Unit tests
npm test