This is an internal utility that exists so our users can pass meaningful
duration strings such as 1h instead of having to manually calculate seconds
or milliseconds.
We turned the Go [ParseDuration][go-parser] into TypeScript so that we have
the exact same functionality in both languages.
When should I use this?
You should not use this but use one of the many alternatives such as
vercel/ms.
This package matches our current needs which are likely different from yours.
Install
This package is ESM only.
Install with npm in Node.js:
We found that @arcjet/duration demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 3 open source maintainers collaborating on the project.
Package last updated on 03 Sep 2025
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.