7.0.0 • Published 2 years ago

gzip-size v7.0.0

Weekly downloads
8,726,405
License
MIT
Repository
github
Last release
2 years ago

gzip-size

Get the gzipped size of a string or buffer

Install

npm install gzip-size

Usage

import {gzipSize, gzipSizeSync} from '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(gzipSizeSync(text));
//=> 78

API

gzipSize(input, options?)

Returns a Promise<number> with the size.

gzipSizeSync(input, options?)

Returns the size.

input

Type: string | Buffer

options

Type: object

Any zlib option.

gzipSizeFromFile(path, options?)

Returns a Promise<number> with the size of the file.

path

Type: string

gzipSizeFromFileSync(path, options?)

Returns the size of the file.

gzipSizeStream(options?)

Returns a stream.PassThrough. The stream emits a gzip-size event and has a gzipSize property.

Related


react-dev-utilswebpack-bundle-analyzeryoyuo-scripts@bsolution/bsolution-dev-utils@proteria/react-scripts@uukit/react-dev-kit@uukit/scriptsvuedragdropuploadimages@akasybe/prometheus-metrics@seasketch-sls-geoprocessing/packaging@jackyef/bundlesizeaerolito-next@fela-next/fela-statistics@omake/react-scriptscustom-react-scripts-with-modules@mohitsingh/react-scripts@mygooder/react-dev-utilsecarx-build-toolcustom-react-dev-utils-anjan@nuxt/deployreact-dev-utils-anjan@app-server/clicloud-archive-s3p-react-dev-utilswebpack-bundle-analyzer-c-patchwebpack-bundle-analyzer-patchantdeco-react-dev-utilsbb-chat@nbarinov/commonphill@texttree/demo-bsa-reference-rcl@klizan/react-dev-utils@codewitchbella/microbundle@medomino-170/medo-ts2medo-ts2gql_din_modalr-react-dev-utils@cvpcasada/nwb@woofjs/cli@kununu/react-universal-scriptsreact-dev-utils-forkchancegraff-dev-utilsreact-scripts-in-public@danifoldi/nitropackbee-react-serverdevops-react-serverhahnbee-testhahnbee-test-clientreact-scripts-by-featurereact-scripts-css-varsreact-scripts-cssm-hmrreact-scripts-thtliife-modreact-storybook-scriptsunblock-block-save-variablesbuilde@krulod/sorcerer@saaspe/componentsopea-bootstraapsklif-ui-kitsklif-api@everything-registry/sub-chunk-1817ivory-react-dev-utils@314oner_npm/universal-components-libraryp149-tablesklif-uizero-projectzero-scriptszjslqshqz-docmazoro-tool@friendsof/spaghetti@funboxteam/harold@freshworks/bundlesizeweb-scriptswebchewebpack-dependency-sizewebpack-bundle-analyzer-brotliwebpack-bundle-analyzer-centro-patchwebpack-bundle-analyzer-jsonwebpack-bundle-analyzer-sunburstwebpack-bundle-analyzer-valscion-tmpwebpack-bundle-phobiawebpack-bundle-size-table-pluginwebpack-build-toolwebpack-build-log-pluginwebpack-marauderwebpack-sizewebpack-size-pluginwebpack-scalpelwebpack-stats-progresswebpack-stats-summaryzinc-react-dev-utilszk-roadhogzx-webpack-bundle-analyzerzxdva-buildzc-react-dev-utilszcatalyst-cli-plugin-reactwix-webpack-bundle-analyzerwodax-umi-webpack-bundle-analyzeryhtml5-dev-utilsxl-maidian
7.0.0

2 years ago

6.0.0

3 years ago

5.1.1

5 years ago

5.1.0

5 years ago

5.0.0

6 years ago

4.1.0

6 years ago

4.0.1

6 years ago

4.0.0

7 years ago

3.0.0

9 years ago

2.1.0

9 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.0

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago