Gathering detailed insights and metrics for pretty-ms
Gathering detailed insights and metrics for pretty-ms
Gathering detailed insights and metrics for pretty-ms
Gathering detailed insights and metrics for pretty-ms
@types/pretty-ms
TypeScript definitions for pretty-ms
pretty-ms-i18n
Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s`
pretty-print-ms
Convert milliseconds to something easier on the eyes
@postman/pretty-ms
Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s`
Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s`
npm install pretty-ms
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.4
Supply Chain
99.5
Quality
80.9
Maintenance
100
Vulnerability
100
License
JavaScript (96.02%)
TypeScript (3.98%)
Total Downloads
820,748,108
Last Day
359,728
Last Week
4,471,560
Last Month
26,149,579
Last Year
251,449,977
1,129 Stars
92 Commits
65 Forks
11 Watching
1 Branches
22 Contributors
Latest Version
9.2.0
Package Id
pretty-ms@9.2.0
Unpacked Size
13.21 kB
Size
4.06 kB
File Count
5
NPM Version
10.6.0
Node Version
18.20.4
Publised On
15 Nov 2024
Cumulative downloads
Total Downloads
Last day
-69.4%
359,728
Compared to previous day
Last week
-31.1%
4,471,560
Compared to previous week
Last month
-1.8%
26,149,579
Compared to previous month
Last year
40.7%
251,449,977
Compared to previous year
Convert milliseconds to a human readable string:
1337000000
→15d 11h 23m 20s
1npm install pretty-ms
1import prettyMilliseconds from 'pretty-ms'; 2 3prettyMilliseconds(1337000000); 4//=> '15d 11h 23m 20s' 5 6prettyMilliseconds(1337000000n); 7//=> '15d 11h 23m 20s' 8 9prettyMilliseconds(1337); 10//=> '1.3s' 11 12prettyMilliseconds(133); 13//=> '133ms' 14 15// `compact` option 16prettyMilliseconds(1337, {compact: true}); 17//=> '1s' 18 19// `verbose` option 20prettyMilliseconds(1335669000, {verbose: true}); 21//=> '15 days 11 hours 1 minute 9 seconds' 22 23// `colonNotation` option 24prettyMilliseconds(95500, {colonNotation: true}); 25//=> '1:35.5' 26 27// `formatSubMilliseconds` option 28prettyMilliseconds(100.400080, {formatSubMilliseconds: true}) 29//=> '100ms 400µs 80ns' 30 31// Can be useful for time durations 32prettyMilliseconds(new Date(2014, 0, 1, 10, 40) - new Date(2014, 0, 1, 10, 5)) 33//=> '35m'
Type: number | bigint
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
Hides the year and shows the hidden year additionally as days (365 per year): 1y 3d 5h 1m 45s
→ 368d 5h 1m 45s
.
Type: boolean
Default: false
Hides the year and days and shows the hidden values additionally as hours: 1y 3d 5h 1m 45s
→ 8837h 1m 45s
.
Type: boolean
Default: false
Hides the seconds: 1y 3d 5h 1m 45s
→ 1y 3d 5h 1m
.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
security policy file detected
Details
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 16/30 approved changesets -- score normalized to 5
Reason
3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
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
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