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

@suluk/editor

v0.1.1

Published

A fully-static, client-only OpenAPI v4 EDITOR (the editor.scalar.com analog, native v4). Two panes: a CodeMirror source editor + a live API reference rendered by the suluk Scalar fork; diagnostics from @suluk/core + @suluk/harden; 3.1→v4 upgrade via @sulu

Readme

@suluk/editor

A fully-static, client-only OpenAPI v4 editor — the editor.scalar.com analog, but native to the Suluk candidate v4 shape (named requests maps, parameterSchema, the 4.0.0-candidate identity, and the x-suluk-* facets). Two panes: a CodeMirror source editor on the left, a live API reference on the right (rendered by the suluk Scalar fork), with a diagnostics bar below.

Everything runs in the browser. The page loads two scripts — the Scalar fork bundle (defines window.Scalar) and this package's pre-built client bundle — and then, on every edit, does parse → validate (@suluk/core) → harden (@suluk/harden) → enrich (@suluk/scalar) → re-mount the preview. There are no server calls. See ADR C033.

What it does

  • Live native-v4 preview — the fork ingests v4 as v4. It shows what a 3.x editor structurally cannot: multiple named requests sharing one method on one path, per-operation cost (x-suluk-cost) and access (x-suluk-access).
  • Diagnostics@suluk/core validation in the lint gutter + a bottom bar, plus the @suluk/harden A–F grade.
  • 3.1 → v4 upgrade — paste a standard OpenAPI 3.1 document, one click converts it to v4 (@suluk/openapi-compat).
  • Show as 3.1 — an honest downgrade preview that lists exactly what v4 features 3.1 cannot represent.
  • JSON / YAML — edit in either; one toggle re-serializes.
  • Examples + ?url= — open the bundled examples or load any remote v4/3.1 document.
  • Share + autosave — a self-contained permalink (the whole doc, gzipped, in the URL hash) and localStorage autosave.

Usage

import { editorHtml, editorResponse } from "@suluk/editor";

// As a string (Bun.serve / Astro / anywhere):
const html = editorHtml({
  brand: "Suluk",
  forkSrc: "/vendor/scalar/standalone-suluk.js", // the suluk Scalar fork (defines window.Scalar)
  clientSrc: "/editor.client.js",                // this package's dist bundle, served as a static asset
});

// Or as a Response (Workers / Hono):
app.get("/", () => editorResponse());

Host three static assets: the page (from editorHtml()), the fork bundle (forkSrc), and this package's client bundle — the prebuilt dist/editor.client.js file (resolvable as the @suluk/editor/client export).

The seed documents are exported too, so you can supply your own Examples dropdown:

import { editorHtml } from "@suluk/editor";
import { examples, defaultExample, type EditorExample } from "@suluk/editor/examples";

const mine: EditorExample[] = [{ id: "mine", label: "My API", doc: { openapi: "4.0.0-candidate", /* … */ } }];
const html = editorHtml({ examples: [...examples, ...mine], initialDoc: defaultExample.doc });

Sub-paths: @suluk/editor (the page builders + the example exports), @suluk/editor/examples (the seed documents on their own), and @suluk/editor/client (the prebuilt browser bundle to serve as clientSrc).

Options

| Option | Default | Meaning | | --- | --- | --- | | pageTitle | "<brand> — OpenAPI v4 editor" | <title> | | brand | "Suluk" | toolbar heading | | forkSrc | /vendor/scalar/standalone-suluk.js | Scalar fork bundle URL | | clientSrc | /editor.client.js | this package's client bundle URL | | examples | the bundled examples | Examples dropdown contents | | initialDoc | the Suluk Galaxy example | document opened when there's no ?url=, #share, or saved draft | | faviconHref, customCss | — | page chrome |

Building the client bundle

bun run build:client   # → dist/editor.client.js (CodeMirror + the @suluk pipeline, browser target)

The bundle is committed so consumers don't need a build step. Rebuild it when the client code or its deps change.

Boundary

This package is the shell. The render engine is the suluk Scalar fork (tooling/ts/scalar-fork), and all validation / audit / conversion is reused verbatim from @suluk/core, @suluk/harden, and @suluk/openapi-compat — in the browser. Nothing of upstream scalar-app is forked; see C033 for why.

CANDIDATE tooling — part of the Suluk OpenAPI v4.0 candidate, not a SIG deliverable.