
Product
Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.
@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
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 59,205 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.
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.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.

Research
More than 140 Mastra npm packages were compromised in a supply chain attack that used a typosquatted dependency to deliver a cross-platform infostealer during installation.