
Security News
Deno Goes the Way of the Dinosaur
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.
@arcjet/duration
Advanced tools
@arcjet/durationArcjet utilities for parsing duration strings.
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.
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.
This package is ESM only. Install with npm in Node.js:
npm install @arcjet/duration
import { parse } from "@arcjet/duration";
const seconds = parse("1h");
console.log(seconds); // prints 3600
This package exports the identifier
parse.
There is no default export.
This package does not export TypeScript types.
parse(value)Parses a duration into a number representing seconds while ensuring the value fits within an unsigned 32-bit integer.
If you pass a number, it is validated and returned as-is.
If you pass a string, it must be in the form of digits followed by a unit.
Supported units are s (seconds),
m (minutes),
h (hours),
and d (days).
value (number or string)
— the duration to parseParsed seconds (number).
console.log(parse("1s")); // => 1
console.log(parse("1m")); // => 60
console.log(parse("1h")); // => 3600
console.log(parse("1d")); // => 86400
Apache License, Version 2.0 © Arcjet Labs, Inc.
Derivative work based on time.ParseDuration from
golang/go licensed under BSD-3.0 © The Go Authors.
Our work ports to TypeScript.
FAQs
Arcjet utilities for parsing duration strings
The npm package @arcjet/duration receives a total of 61,575 weekly downloads. As such, @arcjet/duration popularity was classified as popular.
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 2 open source maintainers collaborating on the project.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.

Security News
On Front Lines’ Early Adopters: CISO podcast, Andrew Becherer shares lessons from Datadog, weighs the long-term costs of AI-built tools, and explains how founders can actually gain a CISO’s trust.