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.14

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 resource-backed job worker: a thin facade composing a Queue (@orkestrel/queue) with a Pool (@orkestrel/pool), where each job's handler runs against an automatically acquired pooled resource released when the job settles.

Create a worker with the createWorker function, give it the pool's create and destroy plus the handler each job runs, then enqueue inputs and await their results. Subscribe to the typed emitter for the job lifecycle the worker re-exposes from its underlying queue. Reach for the server surface's createNodeWorker where the work is CPU-bound: it specializes createWorker over a pool of node:worker_threads and crosses the structured-clone boundary through input and result guards with no as. A thread handler receives { id, signal }: id is the Queue's stable idempotency key across retries and crash restore, and signal is per attempt. That id identifies work, not a caller, and is not authentication or authorization evidence. Part of the @orkestrel line.

Install

npm install @orkestrel/worker

Requirements

The package runs under these conditions:

  • 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/worker.md.

Package

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

License

MIT © Orkestrel — see LICENSE.