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

express-speed

v2.1.0

Published

A simple pager system for Express apps

Downloads

54

Readme

express-speed

express-speed is a lightweight pager system that makes route creation in Express applications more organized and chainable.

🇹🇷 Türkçe dokümantasyon için TR.md dosyasına göz atın.

Goals

  • Simplify route definitions
  • Make pages modular
  • Ease middleware and role-based access control
  • Manage both API and page routes within the same structure

Installation

npm install express-speed

Quick Start

import { expressSpeed } from "express-speed";

expressSpeed.listen(80, {
  page: {
    render: ["./page/**/*.js"],
    exclude: [],
    nodir: true,
  },
  use: [
    (req, res, next) => {
      console.log("request received");
      next();
    },
  ],
  settings: {
    "view engine": "pug",
    views: "./pug",
  },
});

expressSpeed.listen Options

| Key | Type | Description | |-----|------|-------------| | page.render | string[] | Glob patterns to match page files | | page.exclude | string[] | Glob patterns to exclude | | page.nodir | boolean | Skip directories | | use | function[] | Global middleware applied to all routes | | settings | object | Express app settings (view engine, views, etc.) |


Usage

Basic Page

import { pager } from "express-speed";

let page = pager
  .url("/")
  .role("user")
  .get((req, res) => {
    res.send("Simple Page");
  })
  .build();

export default page;

Multiple Handlers

You can define multiple handlers for the same route.

import { pager } from "express-speed";

export default pager
  .url("/example")
  .get((req, res, next) => {
    console.log("first handler");
    next();
  })
  .get((req, res) => {
    res.send("final response");
  })
  .build();

Middleware

import { pager } from "express-speed";

function logger(req, res, next) {
  console.log("page visited");
  next();
}

export default pager
  .url("/profile")
  .use(logger)
  .get((req, res) => {
    res.send("Profile page");
  })
  .build();

Role Based Access

import { pager } from "express-speed";

export default pager
  .url("/admin")
  .role("admin")
  .get((req, res) => {
    res.send("Admin Panel");
  })
  .build();

Sub Path Routes

Use get(path, handler) to create different endpoints within the same pager.

import { pager } from "express-speed";

export default pager
  .url("/blog")
  .get((req, res) => {
    res.send("Blog Home");
  })
  .get("/blog/post/:id", (req, res) => {
    res.send(`Post ${req.params.id}`);
  })
  .get("/blog/latest", (req, res) => {
    res.send("Latest posts");
  })
  .build();

Generated routes:

/blog
/blog/post/:id
/blog/latest

Router Style

import { pager } from "express-speed";

export default pager
  .url("/api")
  .get("/users", (req, res) => {
    res.json(["user1", "user2"]);
  })
  .get("/products", (req, res) => {
    res.json(["product1", "product2"]);
  })
  .build();

GraphQL Integration

npm install express-graphql graphql
import { pager } from "express-speed";
import { graphqlHTTP } from "express-graphql";
import { buildSchema } from "graphql";

const schema = buildSchema(`
  type Query {
    hello: String
  }
`);

const root = {
  hello: () => "Hello GraphQL",
};

export default pager
  .url("/graphql")
  .use(
    graphqlHTTP({
      schema,
      rootValue: root,
      graphiql: true,
    }),
  )
  .build();

Features

  • Chainable route API
  • Express middleware compatibility
  • Role based access control
  • Multiple route handlers
  • Sub path routing
  • Global middleware and settings via listen
  • GraphQL integration
  • API and page route support