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

letchin

v0.0.2

Published

letchin is an http + middleware framwork

Readme

letchin

A minimal HTTP framework built from the ground up using Node’s net module. letchin provides a simple and lightweight approach to building web servers without relying on Node’s built-in http module.

This is the early foundation of a low-level framework inspired by Express and Koa, but implemented entirely from scratch for educational and experimental development.


Installation

npm install letchin

Example Usage

const { tchintchin, mid } = require("letchin");

mid.add("logger", (req, res, next) => {
  console.log(`[${req.method}] ${req.path}`);
  next();
});

const app = tchintchin();

app.route("GET", "/", mid.logger, (req, res) => {
  res.send("Welcome to letchin");
});

app.route("POST", "/data", (req, res) => {
  console.log("Body:", req.body);
  res.send("Data received");
});

app.listen(3000, () => console.log("Server running on port 3000"));

API Overview

tchintchin()

Creates a new application instance.

Methods

| Method | Description | |---------|--------------| | app.route(method, path, ...middlewares, handler) | Define a route with optional middlewares and a final handler. | | app.listen(port, callback) | Start the server on a given port. |


Middleware System

letchin includes a simple middleware manager.

Example

mid.add("auth", (req, res, next) => {
  if (req.get("authorization") !== "secret") {
    res.statusCode = 401;
    res.send("Unauthorized");
  } else next();
});

app.route("GET", "/private", mid.auth, (req, res) => {
  res.send("Access granted");
});

Notes

  • Middleware functions receive (req, res, next).
  • You can define custom middlewares using mid.add(name, fn).
  • Middlewares are executed in order; call next() to continue.

Request Object (req)

Each route handler and middleware receives a req object representing the HTTP request.

| Property | Type | Description | |-----------|------|-------------| | req.method | string | HTTP method (e.g. GET, POST) | | req.path | string | URL path | | req.headers | object | Parsed request headers | | req.body | string | Raw request body | | req.get(name) | function | Returns a header value by name | | req.is(type) | function | Checks if Content-Type contains a given string |


Response Object (res)

Each handler also receives a res object used to send responses.

| Method | Description | |---------|--------------| | res.send(body) | Sends an HTTP response with status 200 and default headers. | | res.statusCode | Property used to set custom status codes before sending. |

Example

app.route("GET", "/custom", (req, res) => {
  res.statusCode = 201;
  res.send("Created");
});

Current Limitations

letchin is still under active minimal development. Current limitations include:

  • No query parameter or URL parameter parsing
  • No JSON auto-parsing middleware
  • No response helpers like .json() or .set()
  • Only handles one request per connection (no Keep-Alive yet)
  • Error handling is basic and synchronous

Roadmap

  • Add .status() and .set() to response
  • Add URL parameter parsing
  • Add middleware chaining improvements
  • Add async body parsing and streaming
  • Introduce a testing utility and logging layer

License

Creative Commons Attribution–NonCommercial 4.0 International (CC BY-NC 4.0) © 2025 Oussama Benoujja

You may share and adapt this work for non-commercial purposes, provided that appropriate credit is given. For the full license text, see Creative Commons License.