jack e1a2621c78 update | il y a 2 ans | |
---|---|---|
.. | ||
index.js | il y a 2 ans | |
license | il y a 2 ans | |
package.json | il y a 2 ans | |
readme.md | il y a 2 ans |
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