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

@theokit/plugin-openapi

v0.1.3

Published

OpenAPI docs UI for TheoKit — mounts Scalar at /api/docs reading the .theo/openapi.json emitted by theokit build/dev.

Readme

@theokit/plugin-openapi

OpenAPI docs UI for TheoKit. Mounts Scalar at /api/docs reading the .theo/openapi.json emitted by theokit build (or theokit dev after P#3 ships).

Zero npm runtime deps on @scalar/* — the UI loads from https://cdn.jsdelivr.net/npm/@scalar/api-reference at request time in the browser. Consumer-app bundle delta: 0 bytes.

Install

pnpm add @theokit/plugin-openapi

Requires theokit >= 0.2.2 (peerDep). Earlier theokit versions don't emit .theo/openapi.json automatically in dev mode.

Quickstart

In your theo.config.ts:

import { defineConfig } from 'theokit'
import openApiPlugin from '@theokit/plugin-openapi'

export default defineConfig({
  // Opt into G2's OpenAPI emit
  openapi: {
    title: 'My App',
    version: '1.0.0',
    servers: [{ url: 'http://localhost:3000' }],
  },
  // Mount the UI
  plugins: [openApiPlugin()],
})

Then pnpm dev and open http://localhost:3000/api/docs.

Options

openApiPlugin({
  docsPath: '/api/docs',                    // HTML page path
  openapiJsonPath: '/api/docs/openapi.json', // JSON served from disk
  openapiSourcePath: '.theo/openapi.json',  // on-disk emit location
  cdnUrl: 'https://cdn.jsdelivr.net/npm/@scalar/api-reference',
  pageTitle: 'API Reference',
})

Offline mode

The default loads Scalar from jsdelivr CDN. For air-gapped deployments, host the Scalar bundle yourself and override cdnUrl:

openApiPlugin({
  cdnUrl: '/static/scalar/api-reference.js',
})

See Scalar's CDN docs for the standalone bundle layout.

How it works

  1. theokit dev / theokit build emits .theo/openapi.json (or dist/openapi.json for prod) when config.openapi is defined (G2 feature, P#3 dev hook).
  2. GET /api/docs → plugin serves HTML referencing Scalar's CDN script.
  3. GET /api/docs/openapi.json → plugin reads the on-disk file + serves as application/json (or 503 OPENAPI_NOT_EMITTED if absent).

License

MIT