Gathering detailed insights and metrics for @postman/pretty-ms
Gathering detailed insights and metrics for @postman/pretty-ms
Gathering detailed insights and metrics for @postman/pretty-ms
Gathering detailed insights and metrics for @postman/pretty-ms
npm install @postman/pretty-ms
Typescript
Module System
Min. Node Version
Node Version
NPM Version
76.3
Supply Chain
99.5
Quality
82.5
Maintenance
100
Vulnerability
100
License
JavaScript (95.26%)
TypeScript (4.74%)
Total Downloads
908,518
Last Day
556
Last Week
2,247
Last Month
10,127
Last Year
412,870
2 Stars
78 Commits
2 Forks
2 Watching
1 Branches
36 Contributors
Minified
Minified + Gzipped
Latest Version
6.1.0
Package Id
@postman/pretty-ms@6.1.0
Unpacked Size
12.41 kB
Size
3.89 kB
File Count
5
NPM Version
6.13.4
Node Version
10.18.1
Cumulative downloads
Total Downloads
Last day
51.9%
556
Compared to previous day
Last week
-28.6%
2,247
Compared to previous week
Last month
200.4%
10,127
Compared to previous month
Last year
359.9%
412,870
Compared to previous year
Convert milliseconds to a human readable string:
1337000000
→15d 11h 23m 20s
$ npm install pretty-ms
1const prettyMilliseconds = require('pretty-ms'); 2 3prettyMilliseconds(1337000000); 4//=> '15d 11h 23m 20s' 5 6prettyMilliseconds(1337); 7//=> '1.3s' 8 9prettyMilliseconds(133); 10//=> '133ms' 11 12// `compact` option 13prettyMilliseconds(1337, {compact: true}); 14//=> '1s' 15 16// `verbose` option 17prettyMilliseconds(1335669000, {verbose: true}); 18//=> '15 days 11 hours 1 minute 9 seconds' 19 20// `colonNotation` option 21prettyMilliseconds(95500, {colonNotation: true}); 22//=> '1:35.5' 23 24// `padUnits` option 25prettyMilliseconds(1337000000, {padUnits: true}); 26//=> '15 d 11 h 23 m 20 s' 27 28// `formatSubMilliseconds` option 29prettyMilliseconds(100.400080, {formatSubMilliseconds: true}) 30//=> '100ms 400µs 80ns' 31 32// Can be useful for time durations 33prettyMilliseconds(new Date(2014, 0, 1, 10, 40) - new Date(2014, 0, 1, 10, 5)) 34//=> '35m'
Type: number
Milliseconds to humanize.
Type: object
Type: number
Default: 1
Number of digits to appear after the seconds decimal point.
Type: number
Default: 0
Number of digits to appear after the milliseconds decimal point.
Useful in combination with process.hrtime()
.
Type: boolean
Default: false
Keep milliseconds on whole seconds: 13s
→ 13.0s
.
Useful when you are showing a number of seconds spent on an operation and don't want the width of the output to change when hitting a whole number.
Type: boolean
Default: false
Only show the first unit: 1h 10m
→ 1h
.
Also ensures that millisecondsDecimalDigits
and secondsDecimalDigits
are both set to 0
.
Type: number
Default: Infinity
Number of units to show. Setting compact
to true
overrides this option.
Type: boolean
Default: false
Use full-length units: 5h 1m 45s
→ 5 hours 1 minute 45 seconds
Type: boolean
Default: false
Show milliseconds separately. This means they won't be included in the decimal part of the seconds.
Type: boolean
Default: false
Show microseconds and nanoseconds.
Type: boolean
Default: false
Display time using colon notation: 5h 1m 45s
→ 5:01:45
. Always shows time in at least minutes: 1s
→ 0:01
Useful when you want to display time without the time units, similar to a digital watch.
Setting colonNotation
to true
overrides the following options to false
:
compact
formatSubMilliseconds
separateMilliseconds
verbose
Type: boolean
Default: false
Setting padUnits
to true
will show the time with a space before the unit 5h 1m 45s
→ 5 h 1 m 45 s
.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/26 approved changesets -- score normalized to 0
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
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
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 More