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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@sagifire/quiver

v0.1.8

Published

A simple and high-performance library for developing web applications

Downloads

12

Readme

Quiver

Lightweight, fast, and type-friendly HTTP router and utilities for Node.js.

Quiver is a small, focused toolkit for building HTTP services. It is framework-agnostic, TypeScript-first, and designed for predictable routing, clear control flow, and safe request/response helpers. Wire Quiver to Node’s native http server and opt into only the parts you need.

Features

  • Minimal core with explicit composition and middleware (pipes)
  • TypeScript-first API with clear types for routes and handlers
  • Fast PATH routing (exact lookups) and PATTERN routing (trie-based)
  • Static file serving with ETag, range requests, and precompressed support
  • Safe RequestContext helpers: .json(), .text(), .bodyJson(), .status(), etc.
  • Structured errors via HttpException

Installation

npm:

npm install @sagifire/quiver

yarn:

yarn add @sagifire/quiver

Quick start

import http from 'node:http'
import { Router, PathRouteType, RequestContext } from '@sagifire/quiver'

const router = new Router()
  .useType(new PathRouteType())

router.addRule({
  type: 'PATH',
  path: '/hello',
  methods: ['GET'],
  handler: (ctx: RequestContext) => {
    ctx.json({ hello: 'world' })
  }
})

const server = http.createServer((req, res) => router.handler(req, res))
server.listen(3000)
console.log('Listening on http://localhost:3000')

API overview

Top-level exports (high level):

  • Router — registers route types, global pipes, and produces an HTTP handler.
  • RequestContext — per-request helper that wraps req/res and exposes helpers and storage.
  • PathRouteType, PatternRouteType, StaticRouteType — built-in route types.
  • StaticIndex — file index for StaticRouteType.
  • HttpException — structured HTTP errors.

Router behavior:

  1. Builds a RequestContext for each request.
  2. Runs global pipes before route matching.
  3. Iterates registered route type instances (in registration order) and tries to match.
  4. Runs matched handler or returns 404 JSON. Thrown HttpExceptions are converted to JSON responses (honors expose).

Refer to the developer guide for full usage, examples and advanced options.

Testing and coverage

Run tests:

npm test
# or
npm run test:cov

The project uses Vitest and V8/c8 coverage. Coverage reports are generated locally or in CI — do not commit generated coverage outputs into git. Use CI artifacts or external services (Codecov, Coveralls) for persistent coverage tracking.

Development scripts

  • npm run dev — start dev server (Vite)
  • npm run build — build distributable bundles
  • npm test — run tests
  • npm run test:cov — run tests with coverage

Contributing

  • Open issues for bugs or feature requests.
  • Fork the repository, create a branch, add tests and a clear PR description.
  • Keep changes typed (TypeScript) and add tests for behavior changes.

License

MIT — see the LICENSE file.

Documentation

Full developer documentation and examples: ./documentation/guide_en.md