Big update!Announcing Socket for GitHub 1.0. Learn more
Socket
BlogLoveFAQ
Install
Log in

gzip-size

Package Overview
Dependencies
1
Maintainers
1
Versions
18
Issues
File Explorer

Advanced tools

gzip-size

Get the gzipped size of a string or buffer

    7.0.0latest

Version published
Maintainers
1
Weekly downloads
11,025,519
decreased by-4.26%

Weekly downloads

Changelog

Source

Breaking

  • Require Node.js 12.20 6b32b3f
  • This package is now pure ESM. Please read this.
  • Moved from a default export to named exports.

https://github.com/sindresorhus/gzip-size/compare/v6.0.0...v7.0.0

Readme

Source

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.


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

What is gzip-size?

Get the gzipped size of a string or buffer

Is gzip-size popular?

The npm package gzip-size receives a total of 8,887,528 weekly downloads. As such, gzip-size popularity was classified as popular.

Is gzip-size well maintained?

We found that gzip-size demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 23 Nov 2021
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc