
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
[![npm version][npm-version-src]][npm-version-href] [![npm downloads][npm-downloads-src]][npm-downloads-href] [![bundle][bundle-src]][bundle-href] [![Codecov][codecov-src]][codecov-href]
unduration is a tiny (0.2kb) library that aims to standardize the way we handle durations in JavaScript, aiming to replace things like:
defineHandler('/', {
ttl: 1000 * 60 * 60 * 24,
// OR worser
ttl: 86_400_000
})
With:
defineHandler('/', {
ttl: '1m',
// OR
ttl: {
minutes: 1,
}
})
Libraries tend to use different formats for durations, which makes it hard to use them together. unduration aims to solve this problem by providing a standard way to define durations, and utilities to use this standard.
Install package:
# npm
npm install unduration
# yarn
yarn add unduration
# pnpm
pnpm install unduration
# bun
bun install unduration
Import:
// ESM
import { defineDuration } from "unduration";
// CommonJS
const { defineDuration } = require("unduration");
corepack enablepnpm installpnpm devMade with 💛
Published under MIT License.
FAQs
[![npm version][npm-version-src]][npm-version-href] [![npm downloads][npm-downloads-src]][npm-downloads-href] [![bundle][bundle-src]][bundle-href] [![Codecov][codecov-src]][codecov-href]
We found that unduration demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.