Package Exports
- gzip-size
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gzip-size) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
gzip-size 
Get the gzipped size of a string or buffer
Install
$ npm install gzip-size
Usage
cosnt gzipSize = require('gzip-size');
const text = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.';
console.log(text.length);
//=> 191
console.log(gzipSize.sync(text));
//=> 78
API
gzipSize(input, options)
Returns a Promise
for the size.
gzipSize.sync(input, options)
Returns the size.
input
Type: string
Buffer
options
Type: Object
Any zlib
option.
gzipSize.stream(options)
Returns a stream.PassThrough
. The stream emits a gzip-size
event and has a gzipSize
property.
Related
- gzip-size-cli - CLI for this module
License
MIT © Sindre Sorhus