Tiny millisecond conversion utility
5.5k
Stars
323
Forks
33
Open issues
30
Contributors
AI Analysis
ms is a lightweight TypeScript utility for converting between various time format strings (e.g., '2 days', '1h') and milliseconds, supporting bidirectional conversion with optional long-form output. It serves developers building Node.js, Deno, Bun, and browser applications who need reliable, type-safe time parsing without external dependencies. This is a specialized utility library best suited for infrastructure and application developers; it is not a general-purpose tool for end users.
Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.
AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.
vercel/ms: A 14-year-old millisecond conversion utility still widely pulled as a transitive dependency
ms is a minimal TypeScript utility that converts human-readable time strings (e.g. '2 days', '1h') to milliseconds and back. It was built for Node.js developers who need lightweight, zero-dependency time parsing — common in timeout configs, cache TTLs, JWT expiry, and logging. Its longevity and npm download counts (it is a transitive dependency of the debug package, itself depended on by millions of projects) make it one of the most-downloaded npm packages by volume, even if it rarely appears as a direct, conscious dependency choice.
Created in March 2012 under the Zeit/Vercel GitHub org, ms has been a core building block of the Node.js ecosystem for over 14 years. It shipped TypeScript support and a v3.0 API refactor (exposing parse/format/parseStrict) at some point prior to mid-2026.
Growth was never driven by marketing — ms accumulated downloads primarily as a transitive dependency of debug, which is itself a dependency of thousands of popular packages. Star growth is slow and steady (4 stars/week as of late June 2026), reflecting organic discovery rather than viral adoption. The v3.0 TypeScript improvements likely drove a secondary wave of direct adoption among TypeScript-first teams.
ms is a transitive dependency of the debug package, which npm download data (external to this analysis) consistently places among the top 10 most-downloaded npm packages globally — implying billions of indirect installs. Direct production usage is evident in Vercel Edge Functions documentation in the README itself. Adoption at scale is well-established, though much of it is indirect.
Appears to be a single-module utility with a parse/format split introduced in v3.0. Likely very small codebase (under 200 lines based on the problem scope). Template Literal Types for input validation suggest careful TypeScript design. Edge Runtime compatibility badge and explicit isomorphic support (browser + Node.js + Deno + Bun) indicate intentional portability.
CI badge is present (GitHub Actions), which likely implies automated tests exist, but coverage specifics are not documented in the README.
Last push was 2026-05-21 — roughly 5 weeks before evaluation date. Given that this is a tiny, stable utility, infrequent pushes signal maturity rather than neglect. CI is active, and the README is well-maintained with modern tooling examples. Maintenance appears healthy.
ADOPT IF: you need lightweight, zero-dependency time string parsing in a Node.js, browser, Deno, or Bun environment — especially for TTLs, timeouts, or JWT expiry. AVOID IF: you require locale-aware duration formatting, ISO 8601 parsing, or nanosecond-level precision; a richer library is more appropriate. MONITOR IF: you rely on it as a direct dependency and want to track whether future v3.x changes alter the TypeScript API surface, which could affect strict typed codebases.
Independent dimensions
Mainstream potential
3/10
Technical importance
5/10
Adoption evidence
9/10
- Indirect dependency risk: most consumers never explicitly depend on ms, meaning version drift via transitive resolution could introduce subtle breakage in large monorepos.
- Narrow scope means the project has little room to expand, which is a feature but also means it cannot grow into a broader utility — teams needing more will have to combine it with other packages.
- Template Literal Types enforcement (parseStrict) requires TypeScript 4.1+, which may be a constraint in older codebases still on TS 3.x.
- Appears to have a single primary maintainer organization (Vercel); if Vercel deprioritizes OSS maintenance, response time for issues could slow, though the library's stability reduces this risk materially.
- The debug package's own trajectory affects ms's indirect download numbers; if debug loses ecosystem share, ms's transitive footprint would shrink accordingly.
ms will remain a stable, long-lived utility. It is unlikely to see dramatic feature additions but will continue to be maintained and will retain its enormous indirect install footprint for the foreseeable future.
Explore similar
Newsletter
Get analyses like this every Monday
Free weekly digest of the most interesting open-source discoveries.
Languages
Information
- Website
- https://npmjs.com/ms
- Language
- TypeScript
- License
- MIT
- Last updated
- 2mo ago
- Created
- 175mo ago
- Analyzed with
- anthropic/claude-haiku-4-5
Stars over time
Contributors over time
Top 100 contributors only — repos with more will plateau at 100.
Open issues
Top contributors
Similar repos
| Repository | Stars | Week Δ | Language | Score | Updated |
|---|---|---|---|---|---|
|
|
5.5k | +2 | TypeScript | 8/10 | 2mo ago |
|
|
1.2k | — | JavaScript | 8/10 | 4d ago |
|
|
10.6k | — | TypeScript | 7/10 | 2mo ago |
|
|
2.2k | — | TypeScript | 8/10 | 23h ago |
|
|
10.1k | — | TypeScript | 7/10 | 10h ago |
|
|
15.9k | — | TypeScript | 8/10 | 12h ago |
moment is far heavier (~300KB), full-featured, and largely in maintenance mode. ms is preferable when only simple string-to-ms conversion is needed with zero overhead.
humanize-duration focuses on formatting durations as readable strings for display; ms focuses on parsing and bidirectional conversion. Different primary use cases with some overlap on the formatting side.
parse-duration supports more unit variety (nanoseconds, etc.) and may be preferred for scientific or high-precision use cases, but ms has a larger install base and TypeScript integration.
dayjs with the duration plugin covers ms's use case but brings the full dayjs library as a dependency. ms wins on bundle size for projects that only need time-string parsing.
Luxon's Duration is far richer (ISO 8601, localization), making it overkill for the simple TTL/timeout scenario where ms excels.