sindresorhus/pretty-ms
Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s` observed · 2026-08-28
Health v2 · maintenance only
66/100
- Activity 91
- Release rhythm 15
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: 304
- age_days: 4549
- days_rel: 352
- days_push: 58
- n_releases_24m: 2
Adoption not part of the score
1215 stars · 69 forks observed · 2026-08-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-08-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 | 66 |
For agents
markdown · JSON · MCP: product_card(name="sindresorhus/pretty-ms")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem