Installations
npm install gzip-size
Developer Guide
Typescript
Yes
Module System
ESM
Min. Node Version
^12.20.0 || ^14.13.1 || >=16.0.0
Node Version
17.0.1
NPM Version
8.1.0
Score
99.3
Supply Chain
89.9
Quality
75.9
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (77.7%)
TypeScript (22.3%)
Developer
sindresorhus
Download Statistics
Total Downloads
2,833,342,519
Last Day
589,759
Last Week
7,508,917
Last Month
45,346,559
Last Year
559,362,149
GitHub Statistics
171 Stars
62 Commits
20 Forks
7 Watching
1 Branches
15 Contributors
Bundle Size
2.09 kB
Minified
891.00 B
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
7.0.0
Package Id
gzip-size@7.0.0
Unpacked Size
8.10 kB
Size
2.92 kB
File Count
5
NPM Version
8.1.0
Node Version
17.0.1
Publised On
23 Nov 2021
Total Downloads
Cumulative downloads
Total Downloads
2,833,342,519
Last day
-72%
589,759
Compared to previous day
Last week
-32.9%
7,508,917
Compared to previous week
Last month
-6.2%
45,346,559
Compared to previous month
Last year
-2.1%
559,362,149
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
gzip-size
Get the gzipped size of a string or buffer
Install
1npm install gzip-size
Usage
1import {gzipSize, gzipSizeSync} from 'gzip-size'; 2 3const 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.'; 4 5console.log(text.length); 6//=> 191 7 8console.log(gzipSizeSync(text)); 9//=> 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
- gzip-size-cli - CLI for this module
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
- Info: security policy file detected: .github/security.md:1
- Info: Found linked content: .github/security.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: .github/security.md:1
- Info: Found text in security policy: .github/security.md:1
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: license:0
- Info: FSF or OSI recognized license: MIT License: license:0
Reason
0 existing vulnerabilities detected
Reason
Found 9/30 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/gzip-size/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/gzip-size/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:20
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 9 are checked with a SAST tool
Score
4.3
/10
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to gzip-size
gzip-size-cli
Get the gzipped size of a file or stdin
gulp-size
Display the size of your project
maxmin
Get a pretty output of the original, minified, gzipped size of a string or buffer: 130 B → 91 B → 53 B (gzip)
@types/gzip-size
Stub TypeScript definitions entry for gzip-size, which provides its own types definitions