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

@exactjs/node-adapter

v0.7.0

Published

Node HTTP hosting for eXact endpoints and rendered application pages.

Readme

@exactjs/node-adapter

Node HTTP hosting for eXact endpoints and rendered application pages.

Usage

import { createServer } from 'node:http';
import { createExactNodeHandler } from '@exactjs/node-adapter';

const exact = createExactNodeHandler(exactRuntime);
createServer(exact).listen(3000);

Use this package with http.createServer() or beneath a custom Node server. It normalizes Node request and response objects; protocol validation and dispatch remain in @exactjs/server. The adapter exposes the incoming Node request as platformRequest. Supply caller services through the top-level requestContexts option when creating the server runtime, as shown in the request-context recipe.

For complete SSR documents, await renderExactRequestToHtmlResponse() from @exactjs/ssr and pass the result to writeNodeResponse(response, rendered, signal). Buffered output is committed with one terminal Node write. Pass progressive responses to the same adapter when shell publication before hydration is required.

createExactNodeHandler() enables adaptive scheduling automatically on Node. For custom page handlers, wrap the complete handler with createNodeHandler(handler) so admission occurs before string or streaming rendering begins. Its callback receives (request, response, signal); forward that signal to rendering and response writing. SSR inherits the same adaptive policy at render entry and after pending component data settles. While adaptive scheduling is active, progressive rendering can share a half-millisecond work window across requests or queue every checkpoint. The controller compares these policies under busy streaming traffic and retains a measured capacity gain without a large event-loop delay increase. Within the budgeted policy, render entry and data resumption can continue immediately until the window expires. Buffered rendering retains the adaptive queue at each checkpoint. Ready components continue synchronously. Create the wrapper once per host.

Quiet requests start immediately. Under sustained event-loop delay, the adapter briefly trials batched starts and compares completed-response capacity and lag with immediate controls before and after the trial. Demand-limited trials can instead demonstrate low delay, spare event-loop capacity, and completion of virtually all admitted work. It backs off unsuccessful trials. A successful policy stays active while event-loop delay is low and the loop has spare capacity; lower offered demand alone does not disable useful scheduling. Sustained busy or lagging traffic resumes reassessment; isolated busy samples do not interrupt a healthy policy. Monitoring stops when idle. The Node HTTP compatibility adapter keeps immediate starts when running on Bun. Native Bun Fetch hosting uses the separate Bun adapter and its automatic admission policy.

Both factories accept { adaptive: false } to disable automatic scheduling and maxBatchSize (default 32) to bound starts per callback. This is not a bound on total rendering time in a turn. createNodeRenderScheduler() remains a low-level, always-yielding gate for an explicit SSR scheduleRender hook. The default renderer already inherits the adaptive policy through the request signal. An explicit hook replaces that render policy; disable adapter admission with { adaptive: false } when supplying a complete custom scheduling policy. The Node gate prefers scheduler.yield() and falls back to setImmediate(); pending disconnects leave the queue promptly.

Use writeNodeResponseBody(response, rendered, signal) when a custom handler owns the remainder of the response. It consumes ordered chunks with Node backpressure and leaves the response open. Use cancelNodeResponseBody(rendered, reason) for a HEAD response or an abandoned body. Each body is single-consumer: write it, request its Web stream, or cancel it exactly once.

createExactNodeHandler() reports unexpected request, response-production, and cleanup failures through the runtime's logger, or to the server console when no logger is supplied. A custom writeNodeResponse(response, result, signal, logger) call can supply the same optional logger. Error responses remain generic; original failures stay in server logs. A failing custom logger falls back to the console without preventing response cleanup. Lower-level writeNodeResponseBody() rejects on failure so its caller can report and terminate its own response.

Documentation | Source on GitHub