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

@runiq/web

v1.3.0

Published

Browser-friendly SDK to parse, layout, and render Runiq diagrams to SVG

Readme

@runiq/web

Browser-friendly SDK to parse, layout, and render Runiq DSL to SVG.

  • ESM package for modern bundlers
  • High-level helpers for parse -> layout -> render
  • Automatic registration for built-in shapes and icon providers
  • Profile-aware rendering for diagrams, sequence diagrams, timelines, schematics, and other specialized profiles
  • Works in browsers and in Node.js server-side rendering environments

Install

npm i @runiq/web
pnpm add @runiq/web
yarn add @runiq/web

Quick Start

import { renderRuniqToSvg } from '@runiq/web';

const text = `diagram "My Diagram" {
  direction TB
  style s1 fillColor: "#eef"
  shape A as @rectangle label:"Hello" style: s1
  shape B as @rectangle label:"World"
  A -link-> B
}`;

const { svg, warnings } = await renderRuniqToSvg(
  text,
  { direction: 'TB' },
  { title: 'Sample' }
);

svg is a complete <svg> string. warnings contains non-fatal renderer notes.

Render Any Supported Profile

Use renderRuniqToSvg when the input may be a specialized profile instead of a plain diagram profile.

import { renderRuniqToSvg } from '@runiq/web';

const text = `sequence "Login" {
  participant "User" as actor
  participant "API" as control
  User -> API: "POST /login"
  API --> User: "200 OK"
}`;

const { svg } = await renderRuniqToSvg(text);

Supported render targets include:

  • diagram
  • sequence
  • timeline
  • faultTree
  • wardley
  • railroad
  • kanban
  • gitgraph
  • treemap
  • pedigree
  • electrical
  • digital
  • pneumatic
  • hydraulic
  • hvac
  • control
  • pid
  • block-diagram

Full Documents

Use parseRuniqDocument when you need all profiles from a source file.

import { parseRuniqDocument, renderRuniqDocumentToSvg } from '@runiq/web';

const document = parseRuniqDocument(text);
const first = await renderRuniqDocumentToSvg(document);
const second = await renderRuniqDocumentToSvg(document, {}, 1);

Use parseRuniqProfile and renderRuniqProfileToSvg when you already know which profile to render.

import { parseRuniqProfile, renderRuniqProfileToSvg } from '@runiq/web';

const profile = parseRuniqProfile(text, 1);
const { svg } = await renderRuniqProfileToSvg(profile);

Lower-Level Diagram Control

The lower-level helpers target the standard diagram profile.

import { parseRuniq, layoutRuniq, renderRuniq } from '@runiq/web';

const ast = parseRuniq(text);
const layout = await layoutRuniq(ast, { spacing: 100, direction: 'LR' });
const { svg } = renderRuniq(ast, layout, { title: 'Custom Title' });

API

  • parseRuniq(text): DiagramAst
  • parseRuniqDocument(text): RuniqDocument
  • parseRuniqProfile(text, index?): Profile
  • layoutRuniq(ast, options?): Promise<LaidOutDiagram>
  • renderRuniq(ast, layout, options?): RenderResult
  • renderRuniqToSvg(text, layoutOptions?, renderOptions?): Promise<RenderResult>
  • renderRuniqProfileToSvg(profile, options?, astVersion?): Promise<RenderResult>
  • renderRuniqDocumentToSvg(document, options?, profileIndex?): Promise<RenderResult>

Specialized renderers from @runiq/renderer-svg and @runiq/renderer-schematic are also re-exported for advanced use.

Server-Side Rendering

The SDK can generate SVG strings without a browser DOM.

import { writeFile } from 'node:fs/promises';
import { renderRuniqToSvg } from '@runiq/web';

const { svg } = await renderRuniqToSvg(text);
await writeFile('diagram.svg', svg, 'utf8');

See the server-side rendering guide in the main docs for framework examples.

License

MIT (c) Runiq Team