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

nextpressjs

v1.0.0

Published

A high-performance HTTP framework for Node.js. Zero dependencies, built on native http module.

Readme

Nextpress

Zero-allocation Node.js HTTP framework built on node:http. No dependencies. Express-like API. V8-optimized internals.

  Nextpress   | ██████████████████████████████████ 121,843 req/s
  Hono        | ████████████████████████████       100,077 req/s
  Koa         | ███████████████████████            83,731 req/s
  Fastify     | ██████████████████████             81,491 req/s
  Express 5   | ███████████████████                69,843 req/s

Benchmarked with autocannon (100 connections, 5s, pipelining 10) on Node v24.5.0 / Apple Silicon. These numbers reflect simple JSON GET responses. Real workloads will differ.

Install

npm install nextpressjs

Requires Node.js >= 18. ESM only.

Quick Start

import { createServer } from 'nextpressjs';

const app = createServer();

app.get('/', (req, res) => {
  res.json({ hello: 'world' });
});

app.listen(3000);

API

import { createServer, jsonParser, cors, serveStatic } from 'nextpressjs';

const app = createServer();

// Middleware
app.use(jsonParser());
app.use(cors());

// Routes
app.get('/users/:id', (req, res) => {
  res.json({ id: req.params.id, query: req.query });
});

app.post('/data', (req, res) => {
  res.json({ received: req.body });
});

// Route groups
app.group('/api/v1', (g) => {
  g.get('/health', (req, res) => res.json({ ok: true }));
});

// Static files
app.use(serveStatic('public'));

// Error handling
app.onError((err, req, res) => {
  res.status(500).json({ error: err.message });
});

app.notFound((req, res) => {
  res.status(404).json({ error: 'not found' });
});

app.listen(3000);

Request

| Property | Description | | -------------- | --------------------------------------- | | req.params | Route parameters (/user/:id) | | req.query | Parsed query string | | req.body | Parsed body (requires jsonParser()) | | req.pathname | URL path without query string | | req.header(n)| Case-insensitive header lookup |

Response

| Method | Description | | ---------------- | ------------------------------------- | | res.json(data) | Send JSON with correct headers | | res.send(text) | Send plain text / HTML | | res.status(n) | Set status code (chainable) |

Benchmarks

Run them yourself:

npm install
npm run build
npm run bench:compare    # Nextpress vs Raw HTTP vs Express vs Fastify
npm run bench:suite      # 8 scenarios x 6 frameworks

Results (Node v24.5.0, Apple Silicon)

| Framework | req/s | Latency (avg) | vs Raw HTTP | | --------- | ----: | ------------: | ----------: | | Raw HTTP | 134,406 | 6.9 ms | 100% | | Nextpress | 121,843 | 7.7 ms | 90.7% | | Hono | 100,077 | 9.5 ms | 74.5% | | Koa | 83,731 | 11.5 ms | 62.3% | | Fastify | 81,491 | 11.8 ms | 60.6% | | Express 5 | 69,843 | 13.8 ms | 52.0% |

JSON GET / with 100 connections, pipelining 10. Full results in benchmarks/results.json.

Benchmark disclaimers: Single-route, no middleware, no I/O. These measure framework overhead only. Your application's performance depends on your workload. Always benchmark your own use case.

Why it's fast

Nextpress gets its speed from four techniques. None are magic - they're just careful engineering:

1. V8 Prototype Patching Properties like req.params, req.query, res.json() are added to IncomingMessage.prototype and ServerResponse.prototype once at import time. Every request object shares the same hidden class from birth, keeping V8's inline caches monomorphic.

2. Zero-Allocation Hot Path Static routes reuse frozen singleton objects for params and query. The router reuses a single result object across all lookups. No closures are created per request.

3. Hybrid Router Static routes (no :param or *) go into a flat Map for O(1) lookup. Parameterized and wildcard routes use a radix tree. Most production traffic hits static routes.

4. Minimal Syscalls res.json() uses a single writeHead() call instead of multiple setHeader() calls. ASCII responses skip Buffer.byteLength() entirely.

Full technical deep-dive: docs/architecture.md

Project Structure

src/
  server.ts            Core server, request pipeline, middleware runner
  router.ts            Radix tree + static Map router
  request-response.ts  V8 prototype patching, req/res helpers
  json-parser.ts       JSON body parser middleware
  cors.ts              CORS middleware
  static.ts            Static file serving
  types.ts             TypeScript type definitions
  index.ts             Public exports

Limitations

Be aware of these before adopting Nextpress:

  • Early-stage project. Not yet battle-tested in production environments.
  • No plugin system. Only global and route-level middleware. No Fastify-style encapsulation.
  • Limited ecosystem. No third-party middleware packages yet. You'll write your own or adapt Express middleware.
  • ESM only. No CommonJS support. Your project needs "type": "module".
  • HTTP/1.1 only. Built on node:http. No HTTP/2 or HTTP/3.
  • Prototype patching. Modifies built-in prototypes at import time. Safe (adds new properties, doesn't overwrite), but means one Nextpress instance per process.

Roadmap

  • [ ] Streaming response API (res.stream())
  • [ ] Lightweight plugin system
  • [ ] Request validation middleware (schema-based, no deps)
  • [ ] HTTP/2 support via node:http2
  • [ ] WebSocket integration
  • [ ] Built-in cluster mode
  • [ ] Real-world benchmark scenarios (DB queries, file I/O, auth chains)
  • [ ] Better TypeScript generics for typed route params

Contributing

See CONTRIBUTING.md for setup instructions, coding guidelines, and the PR process.

Key rule: don't allocate in the hot path. Run benchmarks before and after any change to server.ts, router.ts, or request-response.ts.

License

MIT