# sindresorhus/pretty-ms

Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s`

Repository: https://github.com/sindresorhus/pretty-ms
Canonical: https://ross.abutalabs.com/products/pretty-ms
Language: JavaScript
License: MIT
License Family: permissive
Topics: milliseconds, humanize, npm-package
Last push: 2026-07-06T15:49:50+00:00

## Health v2 (maintenance only)
Score: 66/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 91, release rhythm 15, longevity 100
- inputs: {"age_days": 4549, "days_push": 58, "days_rel": 352, "gap_med": 304, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1215, forks 69 (observed 2026-08-28T04:04:01.138612+00:00)

## What it is
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
- artifact type: library
- maturity: stable
- function: serialization, date-time, developer-tools
- domain: developer-tools, web-development
- platform: cross-platform
- tags: npm-package, humanize, duration-formatting, milliseconds, time-formatting, command-line, nodejs, javascript

## Member repositories
- sindresorhus/pretty-ms (main) score 66

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:01.138612+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:17:18.007519+00:00, confidence not recorded.
  - readme: https://github.com/sindresorhus/pretty-ms (fetched 2026-08-28T04:04:01.138612+00:00, sha 3967b119bb44)
  - registry_npm: https://registry.npmjs.org/pretty-ms (fetched 2026-08-29T12:25:21.405974+00:00, sha d3e02c39dc1b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
