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/vitepress

v0.2.0

Published

RapiDoc for VitePress: OpenAPI reference pages inside your VitePress site, with the operations in the sidebar

Readme

@rapidoc/vitepress

Adds API reference pages to a VitePress site. An OpenAPI document becomes a page drawn by RapiDoc inside your theme, with the API's tags and operations in the sidebar.

npm install @rapidoc/vitepress

1. Wrap the config and name your OpenAPI documents:

// .vitepress/config.mjs
import { defineConfig } from "vitepress";
import { withRapidoc, rapidocSidebar } from "@rapidoc/vitepress";

export default withRapidoc(
  defineConfig({
    title: "My docs",
    themeConfig: {
      sidebar: [
        { text: "Guide", items: [{ text: "Getting started", link: "/" }] },
        { text: "Pets API", items: await rapidocSidebar({ spec: "./openapi.yaml", uiPath: "/api" }) },
      ],
    },
  }),
  { apis: { pets: "./openapi.yaml" } },
);

2. Add the page, for example api.md:

---
title: Pets API
layout: page
---

<script setup>
import { RapidocReference } from "@rapidoc/vitepress/client";
</script>

<RapidocReference api="pets" />

The reference is at /api. layout: page gives it the full content width.

What you get

  • Your theme's layout: its nav, sidebar and dark-mode switch stay; RapiDoc's own header and sidebar are off, and the reference follows the theme's light and dark modes.
  • Operations in the sidebar: rapidocSidebar({ spec, uiPath }) returns an overview link and a group per tag with a link per operation. Each shows its HTTP method (GET, POST, DEL) in RapiDoc's colours, and deprecated operations are struck through. An operation link is a section of the page (/api#list-pets), so moving between operations does not reload it.
  • No request for the spec: the documents in apis are read at build time and shipped with the page's script.
  • Try it and OAuth: the console works as in RapiDoc; the OAuth return page is written to rapidoc/oauth-receiver.html.

API

withRapidoc(config, { apis, root? }) wraps the VitePress config. apis maps a name to an OpenAPI document: a JSON or YAML file (relative to root, default the working directory), a URL or an object. It also lets you write <rapi-doc-mini> directly in Markdown.

rapidocSidebar({ spec, uiPath, ... }) returns sidebar items for one API.

| Option | Default | | | :---------- | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | spec | required | The OpenAPI document: a JSON or YAML file (relative to root), a URL, or the object. It is read when the site is built | | uiPath | required | URL path of the page that shows the reference, for example /api. Operation links point to sections of it | | methods | "as-colored-text" | How each operation's HTTP method is shown: "as-colored-text", "as-plain-text", "as-colored-block", or false for no method. Deprecated operations are struck through either way | | collapsed | | true starts the tag groups collapsed | | root | the working directory | Folder a relative spec file is resolved from |

The form of version 0.1, rapidocSidebar(spec, link, options), still works.

<RapidocReference> props:

| Prop | | | :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | api | A name from apis | | spec | The OpenAPI document as an object, instead of api | | options | Attributes of <rapi-doc>, in kebab-case or camelCase: :options="{ allowTry: false, theme: 'jade' }". They win over the component's own |

Notes

  • The component sets render-style="focused", show-header="false", show-side-nav="false", auto-height="true" and color-scheme="auto". Change any of them through options.
  • The OAuth return page loads the pinned rapidoc version from jsDelivr, because the site's own copy of the bundle has a hashed file name.
  • API pages are not in the local search index: their content is drawn in the browser.
  • Tested on VitePress 1.6 and 2.0 alpha. 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.