sindresorhus/pretty-ms
Some data may be outdated — see provenance labels.
Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s` observed · 2026-09-28
Health v2 · maintenance only
84/100
- Activity 95
- Release rhythm 60
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-10-21. Adoption (stars, forks) is never an input.
- gap_med: 325.5
- age_days: 4597
- days_rel: 53
- days_push: 32
- n_releases_24m: 3
Adoption not part of the score
1216 stars · 70 forks observed · 2026-09-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A small JavaScript library that converts milliseconds into human-readable duration strings like '15d 11h 23m 20s'. It supports options for compact, verbose, and colon notation output, and works with numbers and BigInt.
Use cases
- format milliseconds as human readable duration
- display elapsed time in logs or CLI output
- show time durations in a UI
- convert ms to compact time string
- format durations in colon notation like a stopwatch
- humanize hrtime benchmark results
When to choose
- you need to display durations in a readable format in JavaScript or Node.js
- you want a tiny, dependency-free utility with flexible formatting options
- you need BigInt or sub-millisecond precision support
When to avoid
- you need to parse duration strings into milliseconds (use parse-duration-ms instead)
- you need timezone-aware or calendar date formatting
- you work outside the JavaScript ecosystem
Facets
library · maturity stable
serialization date-time developer-tools developer-tools web-development cross-platform npm-package humanize duration-formatting milliseconds time-formatting command-line nodejs javascript
2 sources
- readme: https://github.com/sindresorhus/pretty-ms · fetched 2026-09-28 · 3967b119bb44
- registry_npm: https://registry.npmjs.org/pretty-ms · fetched 2026-08-29 · d3e02c39dc1b
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| sindresorhus/pretty-ms | main | 84 |
For agents
markdown · JSON · MCP: product_card(name="sindresorhus/pretty-ms")
Data as of 2026-10-19T08:05:51.212177+00:00 · Report a problem