caoge c760052ff9 机车状态修改 | пре 8 месеци | |
---|---|---|
.. | ||
node_modules | пре 8 месеци | |
index.d.ts | пре 8 месеци | |
index.js | пре 8 месеци | |
license | пре 8 месеци | |
package.json | пре 8 месеци | |
readme.md | пре 8 месеци |
Get the gzipped size of a string or buffer
$ npm install gzip-size
const 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
Returns a Promise
for the size.
Returns the size.
Type: string
Buffer
Type: Object
Any zlib
option.
Returns a stream.PassThrough
. The stream emits a gzip-size
event and has a gzipSize
property.
Returns a Promise
for the size of the file.
Type: string
Returns the size of the file.
MIT © Sindre Sorhus