You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hotels/front/node_modules/gzip-size
chen cedac04a0f
本次的提交信息
1 year ago
..
index.d.ts 本次的提交信息 1 year ago
index.js 本次的提交信息 1 year ago
license 本次的提交信息 1 year ago
package.json 本次的提交信息 1 year ago
readme.md 本次的提交信息 1 year ago

readme.md

gzip-size Build Status

Get the gzipped size of a string or buffer

Install

$ npm install gzip-size

Usage

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

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.

gzipSize.file(path, [options])

Returns a Promise for the size of the file.

path

Type: string

gzipSize.fileSync(path, [options])

Returns the size of the file.

License

MIT © Sindre Sorhus