Helper utility to provide pretty printed file sizes
Installations
npm install prettysize
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
10.14.1
NPM Version
6.4.1
Score
99.9
Supply Chain
91.3
Quality
75.3
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
davglass
Download Statistics
Total Downloads
58,808,978
Last Day
51,667
Last Week
236,686
Last Month
991,096
Last Year
9,468,479
GitHub Statistics
65 Stars
44 Commits
9 Forks
3 Watching
2 Branches
5 Contributors
Bundle Size
592.00 B
Minified
410.00 B
Minified + Gzipped
Package Meta Information
Latest Version
2.0.0
Package Id
prettysize@2.0.0
Size
3.30 kB
NPM Version
6.4.1
Node Version
10.14.1
Publised On
07 Dec 2018
Total Downloads
Cumulative downloads
Total Downloads
58,808,978
Last day
6.7%
51,667
Compared to previous day
Last week
-12.2%
236,686
Compared to previous week
Last month
16.8%
991,096
Compared to previous month
Last year
6.3%
9,468,479
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
PrettySize
Helper utility to provide pretty printed file sizes (best used for logging or CLI output)
Build Status
Usage
npm install prettysize
1 2const pretty = require('prettysize'); 3 4let str = pretty(1024); 5 //str = "1 kB" 6 7 str = pretty(1024 * 1024); 8 //str = "1 MB" 9 10 str = pretty(123456789); 11 //str = "117.7 MB"
It supports the following sizes:
- bytes
- kB
- MB
- GB
- TB
- PB
- EB
Arguments
1pretty(123456, true, true, 2); 2 3/* 4 5First arg is size 6Second argument is to remove the space from the output 7Third argument is to use a single character for the size. 8Forth argument is the number of decimal places to return, default is 1. 9Fith argument is to return a converted number without the size string. 10*/ 11 12 13let str = pretty(1024 * 1024, true); 14 //str = "1MB" 15 16 str = pretty(123456789, {nospace: true}) // pretty(123456789, true, true); 17 //str = "117.7M" 18 19 str = pretty(123456789, {one: true}) // pretty(123456789, false, true); 20 //str = "117.7 M" 21 22 str = pretty(123456789, {one: true, places: 2}) // pretty(123456789, false, true, 2); 23 //str = "117.74 M" 24 25 str = pretty(123456789, {one: true, places: 3}) // pretty(123456789, false, true, 3); 26 //str = "117.738 M" 27 28 str = pretty(123456789, {numOnly: true}) // pretty(123456789, false, false, false, true); 29 //num = 117.7 30
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Warn: project license file does not contain an FSF or OSI license.
Reason
Found 4/12 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
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
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 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 23 are checked with a SAST tool
Score
3.4
/10
Last Scanned on 2025-01-27
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 More