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

mizu-router

v1.0.1

Published

Fast zero-dependency trie-based router for Cloudflare Workers

Readme

banner GitHub Release GitHub License NPMJS

Mizu Router

🤔 Why Mizu Router?

Mizu Router is inspired by Hono and boasts the following features:

  1. 🏎️ Extremely Fast: Trie Based routing allows Mizu to scale and perform lookups very instantly
  2. 0️⃣ Zero dependencies: Natively written in typescript and uses standard web APIs
  3. 🐤 Minimalistic and Small: Less than 1.0K when gzipped!
  4. 🌏 Supports Global store: instantiate global objects and pass it to all routes!
  5. 🤨 Supports automated query parsing: Automated query parsing!
  6. 🚏 Supports dynamic routing: /users/:id - id is available via ctx.params
  7. 🔁 Supports subrouting: attach multiple routers expressJS style! (see example below)
  8. ⭐️ Supports wildcard routes: handle wildcard routes! (see example below)

I built this router for fun, as Hono doesn't support global stores and some cool features.

⚡️ Quickstart

import { Router } from "mizu-router";

// 1. Define Env interface for Cloudflare bindings
interface Env {
 SECRET: string;
}

// 2. Define Store interface for global state
interface Store {
 localSecret: string;
}

// Create router with Env and Store types
const router = new Router<Env, Store>();

// 3. Global middleware that initializes store
router.use(async (ctx, next) => {
 // Initialize store with request count
 ctx.store = { localSecret: "hello world - inital store" };
 return next();
});

router.get("/", async (ctx) => {
 // store will be initial value
 return new Response(JSON.stringify({
  secret: ctx.env.SECRET,
  store: ctx.store.localSecret,
 }));
});

// 4. Global middleware that increments request count
router.use(async (ctx, next) => {
 // updating global store
 ctx.store.localSecret = "updated store";
 return next();
});

router.get("/updated", async (ctx) => {
 // store will be updated value
 return new Response(JSON.stringify({
  secret: ctx.env.SECRET,
  store: ctx.store.localSecret,
 }));
});

// Create a subrouter
const userRouter = new Router<Env, Store>();

// 5. Route with dynamic parameter
userRouter.get("/:id", async (ctx) => {
 // Access dynamic parameter
 const userId = ctx.params.id;
 
 // Access query parameters
 const format = ctx.query.format || "json";
 
 return new Response(JSON.stringify({
  userId,
  secret: ctx.env.SECRET,
  localSecret: ctx.store.localSecret,
  format
 }));
});

// 6. Mount subrouter
router.route("/users", userRouter);

// 7. Add wildcard route
router.get("/wildcard/*", async (ctx) => {
 return new Response(JSON.stringify({
  message: "wildcard route",
  path: ctx.params
 }));
});

export default {
 async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
  return router.handle(request, env, {} as Store);
 },
} satisfies ExportedHandler<Env>;

⬇️ Installation

  1. Initalise Cloudflare worker project via wrangler
pnpm dlx wrangler init
  1. Add mizu-router as dependency
pnpm add mizu-router

🤝 Contributions

  • Feel Free to Open a PR/Issue for any feature or bug(s).
  • Make sure you follow the community guidelines.
  • Feel free to open an issue to ask a question/discuss anything about mizu-router.
  • Have a feature request? Open an Issue!
  • Please ensure to run pnpm test before submitting your PRs!

⚖ License

Copyright 2025 Hemanth Krishna

Licensed under MIT License : https://opensource.org/licenses/MIT