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

@ingestkorea/node-simple-router

v1.1.2

Published

Lightweight, zero-dependency native HTTP router for Node.js.

Readme

@ingestkorea/node-simple-router

npm (scoped) npm downloads

Description

Ultra-lightweight, zero-dependency native HTTP router for Node.js built with pure functional middleware.

Install

npm install @ingestkorea/node-simple-router
import { NodeSimpleRouter, Middleware, Result } from "@ingestkorea/node-simple-router";

const port = 3000;
const app = new NodeSimpleRouter({
  debug: true, // default false
});

const middlewareHealth: Middleware = (next) => async (req, res, context) => {
  if (req.method == "HEAD") {
    return res.send(null);
  }

  return next(req, res, context);
};

// Middleware
app.use("/", middlewareHealth);

// API Server
type MyAPIResponse = Result<{ data: string }>;

app.get("/", (req, res, context) => {
  const content: MyAPIResponse = { ok: true, data: "hello world" };
  return res.json(content);
});

app.get("/users/:userId", (req, res, context) => {
  const userId = req.params["userId"];
  const content: MyAPIResponse = { ok: true, data: `userid: ${userId}` };
  return res.json(content);
});

app.get("/error", (req, res) => {
  throw new Error("error test");
});

app.onError((req, res, err, context) => {
  const message = JSON.stringify({
    timestamp: new Date().toISOString(),
    traceId: context.traceId,
    message: err instanceof Error ? err.message : String(err),
  });
  console.error(message);

  const body: MyAPIResponse = { ok: false, message: "something wrong" };
  return res.json(body, { code: 400 });
});

app.listen(port, () => {
  const message = JSON.stringify({
    timestamp: new Date().toISOString(),
    port: port,
    message: "server start",
  });
  console.log(message);
});

Test

curl -i http://localhost:3000

HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
...
x-ik-trace-id: 86fc62fd8d1d44f7befe9319c26a7436

{"ok":true,"data":"hello world"}
{"timestamp":"2026-10-03T12:23:33.534Z","code":200,"path":"GET /","hostname":"localhost","traceId":"86fc62fd8d1d44f7befe9319c26a7436","duration":"0"}
curl -i http://localhost:3000/users/12345

HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
...
x-ik-trace-id: b67687f2219e488587cf1883d12590c1

{"ok":true,"data":"userid: 12345"}
{"timestamp":"2026-10-03T12:25:19.216Z","code":200,"path":"GET /users/12345","hostname":"localhost","traceId":"b67687f2219e488587cf1883d12590c1","duration":"1"}
curl -i http://localhost:3000/error

HTTP/1.1 400 Bad Request
content-type: application/json; charset=utf-8
...
x-ik-trace-id: baade51119824555bdbd1cda04ad76e6

{"ok":false,"message":"something wrong"}
{"timestamp":"2026-10-03T12:28:43.195Z","traceId":"baade51119824555bdbd1cda04ad76e6","message":"error test"}