npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@orkestrel/timeout

v0.0.5

Published

A typed, controllable setTimeout wrapper — an AbortSignal deadline with start/clear lifecycle and parent-signal linking. Part of the @orkestrel line.

Readme

@orkestrel/timeout

A typed, controllable setTimeout wrapper — a deadline handle that exposes an AbortSignal which fires on expiry, for racing against work. Deliberately small: start() arms the deadline, clear() cancels it without firing, and re-start()ing a handle after expiry reuses it for a fresh deadline without re-construction. An optional parent signal links in without inheriting AbortSignal.any semantics — a parent abort during the timing window clears the timeout (it never expires) rather than firing it. Part of the @orkestrel line.

Install

npm install @orkestrel/timeout

Requirements

  • Node.js >= 24
  • ESM-only (no CommonJS build)

Usage

import { createTimeout } from '@orkestrel/timeout'

const timeout = createTimeout({ ms: 5_000 })
timeout.start()
const result = await Promise.race([
	work(),
	new Promise((_, reject) =>
		timeout.signal.addEventListener('abort', () => reject(new Error('timed out')), {
			once: true,
		}),
	),
])
timeout.clear() // work finished first — cancel the deadline

createTimeout(options) (or new Timeout(options)) returns a TimeoutInterface. options.ms must be an integer from 0 through MAX_TIMEOUT_MS (2_147_483_647), inclusive; invalid values throw a coded ContractError before any timer lifecycle begins. Zero is intentionally a next-turn deadline. An optional string options.id labels the handle for tracing and defaults to a random UUID. An optional options.signal must be a genuine native AbortSignal; its abort clears an armed timeout without expiring it, aborting the timeout's own signal, or forwarding its reason. start() arms or replaces the deadline. On expiry expired flips true and the native signal aborts once. clear() cancels without aborting, resets expired, and remains safe to call while idle. isTimeoutDuration and isTimeoutSignal provide total validators for dynamic inputs.

Malformed or unreadable options throw with contract code bound. Invalid defined id, ms, and signal values use literal, range, and placement, respectively, with safe path, limit, and received-value context. expired derives directly from the owned signal's aborted state. validateTimeoutOptions exposes the same strict construction boundary as a once-read helper that returns a fresh copy without absent optional keys.

Guide

For the full surface — the deadline lifecycle, parent-signal linking, and reuse semantics — see guides/src/timeout.md.

Package

Published as a single typed entry point per the exports field in package.json.

License

MIT © Orkestrel — see LICENSE.