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

@toru_yamauchi/wireflow

v1.0.1

Published

DSL-based interactive flow, ER, component, class, and sequence diagram renderer.

Readme

Wireflow

Wireflow is a DSL-based JavaScript diagram renderer for flow diagrams, screen flows, ER diagrams, component diagrams, class diagrams, and sequence diagrams.

It can be used from npm, CDN, or a local bundled file.

Install

npm install @toru_yamauchi/wireflow
import { Wireflow, injectWireflowStyles } from "@toru_yamauchi/wireflow";

injectWireflowStyles();

const wf = new Wireflow(document.getElementById("canvas"), {
  autoFit: true,
});

wf.render(`
layout:
  mode: horizontal
  auto-fit: true

Start:
  Start
  ---
  kind: start

Review:
  Review
  ---
  kind: process

Done:
  Done
  ---
  kind: end

Start -> Review
Review -> Done
`);

CDN

<div data-wireflow-viewport style="height: 420px">
  <div id="canvas"></div>
</div>

<script src="https://cdn.jsdelivr.net/npm/@toru_yamauchi/wireflow/dist/wireflow.min.js"></script>
<script>
  const WF = window.WireflowLib;
  WF.injectWireflowStyles();

  const wf = new WF.Wireflow(document.getElementById("canvas"), {
    autoFit: true,
  });

  wf.render(`
layout:
  mode: horizontal
  auto-fit: true

Input:
  Input
  ---
  kind: screen
  state: accent

Validate:
  Validate
  ---
  kind: decision

Save:
  Save
  ---
  kind: process

Input -> Validate
Validate -> Save:
  on-success: true
`);
</script>

unpkg is also supported:

<script src="https://unpkg.com/@toru_yamauchi/wireflow/dist/wireflow.min.js"></script>

DSL Basics

Wireflow currently uses a YAML-like DSL.

layout:
  mode: horizontal
  auto-fit: true

Home:
  Home
  ---
  kind: screen
  state: accent
  popup: true
  payload: {"title":"Home","desc":"Node details"}

Detail:
  Detail
  ---
  kind: screen

Home:right -> Detail:left:
  label: open

The text above --- is rendered as the node label. The lines below --- are attributes.

Supported Diagram Types

  • Flow diagrams
  • Screen flows
  • ER diagrams
  • Component diagrams
  • Class diagrams
  • Sequence diagrams
  • Notes / comments

Node Attributes

Common node attributes:

| Attribute | Example | Description | |---|---|---| | kind | kind: screen | Node kind such as screen, process, decision, start, end, entity, note | | state | state: success | Visual preset: accent, success, warning, danger, muted | | lane | lane: customer | Swimlane name | | x, y | x: 120 | Manual position | | dx, dy | dx: 16 | Position fine tuning | | popup | popup: true | Enables node click/touch popup events | | payload | payload: {"id":"A1"} | JSON data passed to interaction events | | link | link: https://example.com | Opens a URL on click | | target | target: _blank | Link target | | flow-ref | flow-ref: checkout/main | Subflow reference badge and event |

Edge Syntax

A -> B
A --> B
A - B
A -- B
A:right! -> B:left!:
  label: forced ports

Common edge attributes:

| Attribute | Example | Description | |---|---|---| | label | label: submit | Edge label | | stroke | stroke: #15803d | Edge color | | stroke-width | stroke-width: 4 | Edge width | | marker-end | marker-end: none | Removes arrow marker | | route | route: perimeter | Route strategy | | on-success | on-success: true | Success path styling | | on-failure | on-failure: true | Failure path styling | | parallel-group | parallel-group: stream-1 | Parallel edge separation | | bus | bus: api-bus | Shared bus routing |

ER Diagram

layout:
  mode: horizontal
  auto-fit: true

User:
  PK id bigint
  email varchar(255) UNIQUE NOT NULL
  ---
  kind: entity

Order:
  PK id bigint
  FK user_id bigint NOT NULL
  status varchar(20) NOT NULL
  ---
  kind: entity

User 1--0< Order: "orders"

Field mapping can be written with repeated key: lines.

Order 1--0< OrderLog "audit":
  key: id--order_id
  key: user_id--user_id

Component Diagram

layout:
  mode: horizontal
  auto-fit: true

component Order:
  Order
  ---
  x: 80
  y: 170

component Product:
  Product
  ---
  x: 560
  y: 80

component Account:
  Account
  ---
  x: 560
  y: 300

Order:right! -|o- Product:left!:
  Item Code

Order:bottom! -|--o- Account:left!:
  Account Details

-|o- renders a provided interface connection. -|--o- renders an assembly-style connection where the middle segment is dashed.

Sequence Diagram

sequence:
  User:
    User
    ---
    kind: actor

  App:
    App

  API:
    API

  User -> App: Submit
  App -> API: POST /orders
  API --> App: 201 Created
  App --> User: Done

Notes

Input:
  Input
  ---
  kind: screen

Validate:
  Validate
  ---
  kind: process

note Rule:
  Required fields and format checks
  ---
  target: Validate
  state: warning

Input -> Validate

Public API

import {
  Wireflow,
  parseDsl,
  injectWireflowStyles,
  createPopup,
  parseMdWireflow,
  createFlowNavigator,
} from "@toru_yamauchi/wireflow";

Browser global:

const {
  Wireflow,
  parseDsl,
  injectWireflowStyles,
  createPopup,
} = window.WireflowLib;

Popup

createPopup(document.getElementById("canvas"), {
  render: (id, payload) => `
    <h2>${payload?.title ?? id}</h2>
    <p>${payload?.desc ?? ""}</p>
  `,
});

Nodes with popup: true emit wireflow:box-click and can be handled by createPopup().

Editor History

Wireflow supports undo/redo for DSL-changing interactions.

  • Undo: Ctrl + Z / Cmd + Z
  • Redo: Ctrl + Y / Cmd + Y / Ctrl + Shift + Z
  • Change event: wireflow:dsl-change

License

MIT