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

@rapidoc/express

v1.0.0

Published

RapiDoc for Express: serves an interactive OpenAPI reference (<rapi-doc>) from your Express app

Readme

@rapidoc/express

Serves a RapiDoc API reference from your Express app: an interactive page for your OpenAPI document, with a console to try requests.

npm install @rapidoc/express
import express from "express";
import { rapidoc } from "@rapidoc/express";

const app = express();

app.get("/openapi.json", (req, res) => res.json(openApiDocument));
app.use(rapidoc({ specUrl: "/openapi.json" }));

Open /docs. The middleware answers GET and HEAD on that path and the files under it, and calls next() for every other request.

Mounted under a prefix, the page's links include it:

app.use("/api", rapidoc({ specUrl: "/api/openapi.json" })); // the reference is at /api/docs

Options

| Option | Default | | | :------------- | :-------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | uiPath | /docs | URL path the reference page is served at, within the app or router the middleware is mounted in | | specUrl | | URL of your OpenAPI document, which the browser fetches when the page opens. Use it when the app already serves the document | | spec | | The OpenAPI document itself, as an object or JSON text. It is written into the page, so the browser makes no request for it. With both, spec is shown and specUrl is the download link | | title | API Reference | Page title | | assets | "bundled" | "bundled": the app serves rapidoc-min.js. "cdn": the browser loads the same version from jsDelivr, checked against its SRI hash. { scriptUrl, integrity? }: a URL of your own | | options | | Attributes of <rapi-doc>, in kebab-case or camelCase: { renderStyle: "focused", allowTry: false } | | head, css | | Markup and CSS added to the page as given | | lang | en | Language of the page | | nonce | | Content-Security-Policy nonce, or a function that reads it from the request | | publicUiPath | | The page's whole path as the browser sees it. Only for a proxy that strips a prefix before the request reaches the app; a prefix inside the app is added without it | | enabled | true | false serves nothing, for example outside development |

These are the options of every RapiDoc integration. An empty string counts as an option that is not set.

With helmet

app.use(rapidoc({ specUrl: "/openapi.json", nonce: (req, res) => res.locals.cspNonce }));

<rapi-doc> also needs connect-src to allow the API servers it sends requests to.

Notes

  • Works with Express 4 and 5, Connect, and a plain node:http server (rapidoc(options)(req, res, next)).
  • Each release serves one version of rapidoc, exported as rapidocVersion. The package serves the current major of RapiDoc; a new RapiDoc major arrives as a minor release of this package.
  • The bundle is sent with cache-control: no-cache and an ETag, so browsers pick up a new RapiDoc build on the first visit after a deploy and get a 304 otherwise.
  • OAuth sign-in returns to {uiPath}/oauth-receiver.html, which the middleware serves on your own origin, also with assets: "cdn".
  • examples/server.js is a complete app.

Node.js 22.12 or later. MIT.


Part of the RapiDoc family of open-source tools for OpenAPI and Arazzo: RapiDoc (<rapi-doc>), RapiFlow, RapiDoc Portal, RapiMock, RapiPdf, the RapiDoc CLI and integrations for Express, Fastify, Hono, FastAPI, ASP.NET Core, Go, Starlight, VitePress and Docusaurus.