
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
@arcjet/duration
Advanced tools
@arcjet/duration
Arcjet utilities for parsing duration strings.
npm install -S @arcjet/duration
import { parse } from "@arcjet/duration";
const seconds = parse("1h");
console.log(seconds); // prints 3600
The implementation of this library is based on the ParseDuration function in the Go stdlib. Originally licensed BSD-3.0 with the license included in our source code.
We've chosen the approach of porting this to TypeScript because our protocol operates exclusively on unsigned 32-bit integers representing seconds. However, we don't want to require our SDK users to manually calculate seconds. By providing this utility, our SDK can accept duration strings and numbers while normalizing the values for our protocol.
Licensed under the Apache License, Version 2.0.
1.0.0-beta.9 (2025-07-09)
keywords
to package.json
s (#4408) (4f09478)jco
name in dependabot (#4371) (809fe76)expect
, references to jest
(#4415) (2c44c39)files
fields in package.json
s (#4441) (fd7913b)nbsp
with regular space (#4503) (274114d)analyze
(#4564) (7ef59bb)FAQs
Arcjet utilities for parsing duration strings
The npm package @arcjet/duration receives a total of 19,995 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 3 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.
Security News
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.