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

typed-express

v1.1.0

Published

Make express.js fully-typed

Readme

typed-express

npm version npm download

Make express.js fully-typed and serve automatically generated OpenAPI Specification object.

Features

Create Routes

  • use Switch and Route to create routes.
  • use Parameter and Schema to define request parameter / response body schema.
  • if you need, you can pass middlewares.
export const PostRouter = new Switch("/posts", [
  Route.GET(
    "/{id}",
    "getPost",
    {
      id: Parameter.Path(Schema.String()),
    },
    Schema.Object({
      id: Schema.String(),
      title: Schema.String(),
      content: Schema.String(),
    }),
    async (req, res) => {
      /* ... */
    },
    { middlewares: [/* ... */] } // This is optional
  )
]);

Fully-Typed Request Parameters And Response Body

request parameters and response body type are fully-typed.

Request Parameters Validation

typed-express automatically validates request parameters.

for example, assume that you define router below,

new Switch("/users", [
  Route.GET(
    "/{id}",
    "getUser",
    {
      id: Parameter.Path(Schema.Number()),
    },
    Schema.Object({
      id: Schema.String(),
      name: Schema.String(),
    }),
    async (req, res) => {
      /* ... */
    },
  ),
]);

and then you create an invalid request like GET /users/asdf, you'll get 400 response with error message(s).

parameter [id]: should be number

OpenAPI Route

you can create OpenAPI Specification and serve it by using OpenAPIRoute.

const AllRouter = new Switch("/", [
  PostRouter,
  CategoryRouter,
]);

const OpenAPI = new OpenAPIRoute(
  "/openapi",
  {
    title: "hoseungJangBlogAPI",
    version: "1.0.0",
  },
  AllRouter,
  Entities
);

export const RootRouter = new Switch("/", [
  OpenAPI,
  AllRouter,
]);

if user requests to /openapi in the code above, OpenAPIRoute returns automatically generated OpenAPI Specification object.