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

kekexpress

v0.2.1

Published

Naive express-like library to create http server application.

Readme

Kekexpress (кекекспрес)

Naive express-like library to create http server application. Uses json parser by default.

Installation

npm i kekexpress

Simple Usage Example

const { Server } = require("kexpress");

// Creating server
const app = new Server();

// Applying global middlewares for application
app.middleware((req, res, next) => {
  console.log(req, res);
  
  // You can call next just like in express library
  next();
});

// Applying spesific hanler for url path
// Also supports 'put', 'patch', 'delete' and 'post' methods
app.get("/", (req, res) => {
  res.status(200).json({ message: "Hello world" })
});

// Special handler for unknown routes
app.notFound((req, res) => {
  res.status(404).json({ message: "Route not found" })
});

// Everytime when app throws Error inside route handlers
// it will be passed here
app.error((req, res, error) => {
  res.status(500).json({ message: error.message })
});

// Starting server on port
app.listen(3000, () => {  
  console.log("Server has been started on port 3000");  
});

Usage with multiple routers

const { Server, Router } = require("kexpress");

const app = new Server();
...
// Argument is the prefix for all routes
const router = new Router("/user"); 

// The same api as for Server class
// middleware, get, put, etc.
router.get('/', ...);

// Applying router for server
app.use(router);

// You can also create nested routers
const subRouter = new Router("/new");
router.use(subRouter);

...
app.listen(3000, () => {  
  console.log("Server has been started on port 3000");  
});

Route params

...
// You can specify route params using {name} syntax
router.get("/{id}", (req, res) => {
  const { id } = req.params;
  res.status(200).json({ message: "Hello world " + id })
});
...

Additinal handlers for routes

...
// You can throw error here and then handle it inside
// global app 'error' handler
const validateParam = (req, res, next) => {
  if (!req.params.id) {
    throw new ValidationError('Id is not specifiend')
  }
}
const validateBody = ...;

// You can apply additional handler to validate request
// or to do some extra work before each route
router.get('/', validateParam, validateBody, handler);
...
app.error(req, res, error) => {
  if (error instanceof ValidationError) {
    res.status(400).json({ message: error.message });
  } else {
    res.status(500).json({ message: error.message });
  }
});

API

Request

  • url - request url;
  • method - request method;
  • params - parsed params from route url (/{name} - name is a parameter);
  • query - parsed query params from route url (/user?id=2&test=3 - id and test are query params);
  • body - parsed JSON body. Server accepts only JSON format;
  • httpRequest - base request object from node.js http module.

Response

  • status(statusCode) - sets response status code;
  • send(message) - sends respose with some text back to user;
  • json(data) - sends respose with data in JSON format;
  • html(htmlData) - sends respose with html;
  • setHeader(headerKey, headerValue) - sets header to reponse;
  • isFinished - check if response was already sended. Not needed to trigger by you, but maybe there will be some edge cases;
  • httpResponse - base response object from node.js http module.

Server

  • httpServer - base server object from node.js http module;
  • listen(port, callback) - starts server on port;
  • close(callback) - stops server;
  • |get, post, put, patch, delete|(url, ...handlers) - adds handlers by url and selected method;
  • notFound(callback) - runs callback when route is not found;
  • error(callback) - runs callback when error was thrown inside route handler;
  • middleware(...handlers) - adds middleware to the server.

Router

  • constructor(prefix) - creates router with prefix;
  • use(router) - adds nested router into current router;
  • |get, post, put, patch, delete|(url, ...handlers) - adds handlers by url and selected method;
  • middleware(...handlers) - adds middleware to all routes inside router.

Release History

  • 0.2.0 - Added support of next() inside route handlers
  • 0.1.2 - Package renaming
  • 0.1.1 - Added example of usage
  • 0.1.0 - Initial release, working functionality