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

v0.0.10

Published

A typed HTTP server for the @orkestrel line — composes the @orkestrel/router dispatcher behind a managed lifecycle. Part of the @orkestrel line.

Readme

@orkestrel/server

A typed HTTP server for the @orkestrel line — composes an @orkestrel/router dispatcher behind a managed lifecycle (start/stop/drain/destroy) over a node adapter seam, with a middleware onion, response observability, and a shared substrate for cookies, tokens, content negotiation, and SSE. Built to sit beside @orkestrel/router (routing, matching, and dispatch), @orkestrel/contract (validation), @orkestrel/emitter (observable lifecycle), and @orkestrel/abort (cancellation). Part of the @orkestrel line.

Install

npm install @orkestrel/server

Requirements

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

Usage

import type { MiddlewareHandler } from '@orkestrel/server'
import { createServer } from '@orkestrel/server'
import { createDispatcher } from '@orkestrel/router'

interface State {
	readonly requestId: string
}

const dispatcher = createDispatcher<State>()
dispatcher.add({
	method: 'GET',
	path: '/users/:id',
	handler: (_request, context) =>
		Response.json({ id: context.params.id, requestId: context.state.requestId }),
})

const withRequestId: MiddlewareHandler<State> = async (_request, context, next) => {
	const response = await next()
	response.headers.set('X-Request-ID', context.state.requestId)
	return response
}

const server = createServer<State>({
	dispatcher,
	state: () => ({ requestId: crypto.randomUUID() }),
	middleware: [withRequestId],
})
const port = await server.start()
await server.stop()

A route handler reads context.state exactly as middleware wrote it — the composed onion terminates in the dispatcher, so there is no second plumbing layer between the middleware seam and the router. The package also exports HTTPError and its subclasses, the compose middleware primitive, cookie/token/body helpers, Negotiator for content negotiation, and openStream for Server-Sent Events.

Guide

For the full surface — the middleware seam, HTTPError vocabulary, shared substrate (cookies, tokens, negotiation, ETag/Range, security headers, SSE, body pipeline), and the Server lifecycle entity — see guides/src/server.md.

Package

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

License

MIT © Orkestrel — see LICENSE.