Skip to content

replace ms with ms-tiny#1012

Open
ofershap wants to merge 1 commit intoauth0:masterfrom
ofershap:replace-ms-with-ms-tiny
Open

replace ms with ms-tiny#1012
ofershap wants to merge 1 commit intoauth0:masterfrom
ofershap:replace-ms-with-ms-tiny

Conversation

@ofershap
Copy link

@ofershap ofershap commented Feb 26, 2026

ms has no TypeScript types, no ESM exports, and returns undefined on invalid input.

ms-tiny is a drop-in replacement with the same API. Ships ESM + CJS with built-in types. 833 bytes gzipped, zero deps.

The only code change beyond the import swap is a try-catch in timespan.js because ms-tiny throws on invalid input instead of returning undefined (the undefined check right after still produces the same JsonWebTokenError).

All 511 tests pass.

ms-tiny is API-compatible and ships ESM + CJS with TypeScript types.
833 bytes gzipped, zero dependencies.

Wrapped ms() call in try-catch in timespan.js since ms-tiny throws
on invalid input instead of returning undefined.

Made-with: Cursor
@ofershap ofershap force-pushed the replace-ms-with-ms-tiny branch from f9afe11 to 6c9f745 Compare February 26, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant