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

@orrery-diagrams/core

v0.4.0

Published

The Orrery model: schema, validator, declaration, view scoping, packs, shapes and the SVG renderer.

Readme

@orrery-diagrams/core

The Orrery model: the JSON Schema, the validator, a moment of the model, view scoping, packs, shapes and the SVG renderer. Everything the orrery command does is a call into this package, and it runs in Node 22+ and in a browser. The model is specified in docs/MODEL.md.

npm install @orrery-diagrams/core @orrery-diagrams/layout-elk
import { validate, render, renderDocument, renderExport } from "@orrery-diagrams/core";
import { ElkLayoutEngine } from "@orrery-diagrams/layout-elk";

const r = validate(JSON.parse(await readFile("app.orrery.json", "utf8")));
if (!r.ok) for (const e of r.errors) console.error(e.toString()); // "/components/2/kind: unknown kind ..."
else {
  const still = await render(r.model, new ElkLayoutEngine(), { view: "overview", scenario: "db-fails", step: 1 });
  const interactive = await renderDocument(r.model, new ElkLayoutEngine(), { runtime: RUNTIME_SOURCE }); // from @orrery-diagrams/runtime
  for (const x of r.model.exports) await writeFile(`${x.id}.svg`, await renderExport(r.model, new ElkLayoutEngine(), x));
}

The public API

The root export is the whole of what semver covers, and a test pins the list:

| Export | What | |---|---| | the model's types | Model, Component, Connection, Group, View, Scenario, Export, Pack, ... | | validate(input, { packs? }) | The schema, then every rule of the specification, with pointer-addressed errors and warnings; returns the normalised model. packs hands over vocabularies in code, for a browser or a bundler. | | schema | The JSON Schema, as an object. | | declare(model, { scenario?, step?, set? }) | One moment of the model: the states, reasons and loads a scenario step or a what-if declares, applied. | | render, renderDocument, renderExport | A still of one view, the interactive file with every view and drill-down embedded, or one entry of the model's exports. | | loadPack, packNames, packProblem, installHint, PROVIDER_PACKS | The vocabulary packs: sre is built in; the providers' icon packs are their own packages under the providers' terms. | | sanitizeGlyph | A custom icon's markup, rebuilt from an allowlist of drawing elements and attributes. | | LayoutEngine, LayoutGraph, LayoutResult | The contract a layout engine implements: a graph of measured boxes in, positions and routes out. | | ModelError, ValidationError, ValidationWarning | What the calls throw or return. |

Two more entry points exist and are not promised by semver:

  • @orrery-diagrams/core/internal (and /internal/<module>): the renderer's parts, for the runtime, the raster and the tools: defaults, measurement, view scoping, flow timing, looks, shapes, the sequence layout.
  • @orrery-diagrams/core/testing: FakeLayoutEngine, a layout engine that lays out without ELK, for tests.

Packs

A model says "kinds": { "use": ["aws"] } and names kinds like aws:s3. The aws, azure and gcp packs are separate packages, @orrery-diagrams/pack-aws and so on, because the icons are the providers' and come under their terms rather than this package's MIT licence; installing one is accepting those terms. A missing pack fails validation naming the package to add. See docs/PACKS.md.

Licence

MIT. The provider icon packs are not part of this package.