jack e1a2621c78 update | 2 years ago | |
---|---|---|
.. | ||
index.js | 2 years ago | |
license | 2 years ago | |
package.json | 2 years ago | |
readme.md | 2 years ago |
Get the gzipped size of a string or buffer
$ npm install --save gzip-size
var gzipSize = require('gzip-size');
var string = '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(string.length);
//=> 191
console.log(gzipSize.sync(string));
//=> 78
Type: string
, buffer
Type: function
Returns a passthrough stream. The stream emits a gzip-size
event and has a gzipSize
property.
MIT © Sindre Sorhus