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/worker

v0.0.6

Published

A typed, resource-backed job worker for the @orkestrel line — a Queue paired with a Pool over an execution seam, plus a node:worker_threads server surface for CPU-parallel jobs. Part of the @orkestrel line.

Readme

@orkestrel/worker

A typed, resource-backed job worker for the @orkestrel line: a Worker is a Queue (@orkestrel/queue) whose handler runs against an automatically acquired resource leased from a Pool (@orkestrel/pool) — released when the job settles, even on throw. Composition, not reimplementation: all concurrency, retries, per-attempt timeout, abort, and durability are the Queue's; all idle reuse and max backpressure are the Pool's. The worker is observable (a typed emitter re-exposes the underlying queue's job lifecycle — enqueue / start / retry / success / failure / abort / drain). For CPU-parallel work, the server surface's createNodeWorker specializes the core createWorker over a pool of node:worker_threads, crossing the structured-clone boundary with zero as via input / result guards. Each thread handler receives { id, signal }: id is the Queue's stable idempotency key across retries and crash restore, while signal is per attempt. The wire protocol separately mints a fresh correlation id for each dispatch so a stale reply cannot settle a later retry. The stable id identifies work, not a caller, and is not authentication or authorization evidence; per-job consumer context remains explicit structured-cloneable input rather than ambient thread state. Part of the @orkestrel line.

Install

npm install @orkestrel/worker

Requirements

  • Node.js >= 22.12.0
  • ESM and CommonJS builds ship for both the core and server entry points

Usage

import { createWorker } from '@orkestrel/worker'

const worker = createWorker<Query, Connection, Rows>({
	pool: { create: () => connect(), destroy: (connection) => connection.close() },
	handler: (query, connection, { signal }) => connection.run(query, signal),
	concurrency: 4, // up to four jobs in flight; the pool defaults its `max` to match
	retries: 1,
})

const rows = await worker.enqueue(query)
await worker.destroy() // awaits queue cleanup, then pool cleanup, then emitter teardown

CPU-parallel jobs over node:worker_threads:

import { createNodeWorker } from '@orkestrel/worker/server'

const isNumber = (value: unknown): value is number => typeof value === 'number'

const worker = createNodeWorker({
	script: new URL('./double.js', import.meta.url),
	input: isNumber,
	result: isNumber,
	concurrency: 4,
})

const doubled = await worker.enqueue(21) // 42, computed on a worker thread
await worker.destroy()

Guide

For the full surface — the Worker facade, createNodeWorker / serveWorker, the durable createJSONQueueStore, the observable emitter, and usage patterns — see guides/src/worker.md.

Package

Published with two entry points per the exports field in package.json: the environment-agnostic core (.) and the Node-only server surface (./server).

License

MIT © Orkestrel — see LICENSE.