vercel

vercel/ms

TypeScript MIT Dev Tools

Tiny millisecond conversion utility

5.5k stars
323 forks
slow
GitHub +2 / week

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.

Dev Tools Library Discovery value: 3/10
Documentation 9/10
Activity 7/10
Community 8/10
Code quality 8/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 8/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

time-conversion typescript-utility milliseconds parsing type-safe
Actively maintained Well documented MIT licensed Niche/specialized use case Beginner friendly Production ready
Deep Analysis · Based on README and public signals
2w ago

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.

Origin

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

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.

In production

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.

Code analysis
Architecture

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.

Tests

CI badge is present (GitHub Actions), which likely implies automated tests exist, but coverage specifics are not documented in the README.

Maintenance

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.

Honest verdict

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

Risks
  • 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.
Prediction

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.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

TypeScript
100%

Information

Language
TypeScript
License
MIT
Last updated
2mo ago
Created
175mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Similar repos

sindresorhus

sindresorhus/pretty-ms

pretty-ms converts milliseconds to human-readable duration strings (e.g.,...

1.2k JavaScript Dev Tools
vercel

vercel/micro

Micro is a lightweight, production-focused HTTP microservices framework for...

10.6k TypeScript Dev Tools
vercel

vercel/chat

A unified TypeScript SDK for building chat bots that work across Slack,...

2.2k TypeScript Dev Tools
vercel-labs

vercel-labs/portless

Portless replaces port numbers with stable, named .localhost URLs for local...

10.1k TypeScript Dev Tools
vercel

vercel/vercel

Vercel is the official CLI and platform repository for Vercel's cloud...

15.9k TypeScript DevOps
vs. alternatives
moment.js duration parsing

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 (npm)

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 (npm)

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 duration plugin

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 Duration

Luxon's Duration is far richer (ISO 8601, localization), making it overkill for the simple TTL/timeout scenario where ms excels.