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

docusaurus-plugin-omg

v0.1.1

Published

Docusaurus v3 plugin that compiles OMG (omg.gs, OpenAPI Markdown Grammar) into OpenAPI 3.1 at build time, ready for any OpenAPI renderer

Readme

docusaurus-plugin-omg

Docusaurus v3 plugin that compiles OMG (OpenAPI Markdown Grammar) source files to OpenAPI 3.1 at build time, ready for any OpenAPI renderer.

OMG is a Markdown DSL for writing API specs — roughly 6× shorter than raw OpenAPI YAML. This plugin runs the omg-parser + omg-compiler pipeline as part of docusaurus build / docusaurus start and drops the resulting .yaml (or .json) on disk so a renderer plugin — redocusaurus, docusaurus-plugin-openapi-docs, standalone Swagger UI — can pick it up.

Deliberately thin: no bundled renderer, no opinions about how the spec gets displayed.

Install

npm install docusaurus-plugin-omg

Configure

import type { PluginOmgOptions } from 'docusaurus-plugin-omg'

const omgOptions: PluginOmgOptions = {
  apis: [
    { id: 'todo', input: 'api/todo/api.omg.md' },
    { id: 'billing', input: 'api/billing/api.omg.md', format: 'json' },
  ],
}

export default {
  plugins: [['docusaurus-plugin-omg', omgOptions]],
}

Options

| Option | Type | Default | Notes | | ----------- | ------------------ | -------------- | ------------------------------------------------------------ | | apis | OmgApiInput[] | [] | APIs to compile. | | outputDir | string | 'static/api' | Default directory for compiled specs, relative to site root. | | format | 'yaml' \| 'json' | 'yaml' | Default output format for APIs that don't override it. |

OmgApiInput

| Field | Type | Default | Notes | | -------- | ------------------ | --------------------------- | --------------------------------------------------------------------------------------------- | | id | string | — | Required. Used as the compiled filename when output is not set; also surfaced in log lines. | | input | string | — | Required. Path to the root .omg.md file, relative to the Docusaurus site root. | | output | string | <outputDir>/<id>.<format> | Output path, relative to the site root. | | format | 'yaml' \| 'json' | plugin-level format | Overrides the default for this API only. |

With the default outputDir of static/api, the compiled spec lands in your site's static/ directory and is served at /api/<id>.yaml (or .json) at runtime. Any renderer can fetch that URL, or a build-time renderer plugin can read the file directly.

OMG source layout

OMG specs are a root api.omg.md plus per-endpoint files in endpoints/ (and optional partials/):

api/todo/
  api.omg.md                  # info: name, version, baseUrl, auth, servers
  endpoints/
    list-todos.omg.md         # method, path, body, responses
    create-todo.omg.md
  partials/
    errors.omg.md             # shared response fragments

The plugin's input points at the root api.omg.md; the parser walks the rest.

See the OMG syntax reference for the source format.

Watch mode

During docusaurus start the plugin reports the parent directory of each input via getPathsToWatch, so edits to .omg.md files trigger a rebuild.

Handing off to a renderer

Redocusaurus (Redoc)

plugins: [
  ['docusaurus-plugin-omg', { apis: [{ id: 'todo', input: 'api/todo/api.omg.md' }] }],
],
presets: [
  ['redocusaurus', {
    specs: [{ id: 'todo', spec: 'static/api/todo.yaml', route: '/api/todo/' }],
  }],
],

docusaurus-plugin-openapi-docs (MDX page per endpoint)

plugins: [
  ['docusaurus-plugin-omg', { apis: [{ id: 'todo', input: 'api/todo/api.omg.md' }] }],
  ['docusaurus-plugin-openapi-docs', {
    id: 'api',
    docsPluginId: 'classic',
    config: {
      todo: {
        specPath: 'static/api/todo.yaml',
        outputDir: 'docs/api/todo',
        sidebarOptions: { groupPathsBy: 'tag' },
      },
    },
  }],
],

Both plugins will pick up the file the OMG plugin just wrote. Run docusaurus-plugin-openapi-docs's gen-api-docs script after each change.

Example site

npm install
npm run build            # build the plugin once
npm run example:start    # starts examples/sample-site at http://localhost:3000

License

MIT