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

@dskripchenko/diagrams

v1.3.0

Published

Diagrams from text — Mermaid and PlantUML syntaxes — rendered to SVG with zero runtime dependencies: flowchart, sequence, state, ER, class, C4, pie, gantt, timeline, XY chart, mind map, user journey, quadrant, kanban, requirement, architecture, sankey, gi

Readme

@dskripchenko/diagrams

CI npm license

Diagrams written as text — in Mermaid, PlantUML, Graphviz DOT, D2, DBML, Structurizr DSL or the Wardley map DSL — rendered to SVG, with no runtime dependencies and no DOM. A string goes in, a string of SVG comes out: the same call works in a browser, in server-side rendering and in a Node build script.

import { render } from '@dskripchenko/diagrams'

const { svg } = render(`flowchart LR
  A[Request] --> B{Valid?}
  B -->|yes| C[Render PDF]
  B -->|no| D[Reject]`)

element.innerHTML = svg

// PlantUML: recognised by its @startuml.
render(`@startuml
actor User
User -> API ++ : POST /orders
return 201
@enduml`)

Supported: flowchart (with subgraphs and per-subgraph direction), sequenceDiagram, stateDiagram-v2, erDiagram, classDiagram, C4 (C4Context, C4Container, C4Component, C4Dynamic, C4Deployment), pie, gantt, timeline, xychart-beta, mindmap, journey, quadrantChart, kanban, requirementDiagram, architecture-beta, sankey-beta, gitGraph, block-beta; PlantUML sequence, use case, component, deployment, activity (with swimlanes), class, object, state, ER, C4 (C4-PlantUML) and timing diagrams, mind maps, WBS, Gantt charts and Salt wireframes; Graphviz DOT and D2 (drawn as flowcharts), DBML (as ER diagrams), Structurizr DSL (as C4) and Wardley maps. The syntax is recognised from how a source starts, or given with render(source, { syntax }).

Why another renderer

  • Zero dependencies. Mermaid pulls in d3, dagre, DOMPurify and more — megabytes. This package is one module of about 100 KB gzipped before your bundler minifies it, layout engine included.
  • Safe by construction. Every label and attribute is escaped by the one SVG builder that produces the output; HTML in labels is shown as text. Styles are parsed and limited to a fixed set of properties with validated values, links to http(s), mailto and relative addresses. Nothing from the diagram text is ever executed.
  • Deterministic. The same source and the same text measurer give the same SVG, byte for byte — diagrams can be snapshot-tested and cached.
  • Themeable with CSS. Every colour is a CSS custom property (--dg-*) with a default; a dark theme is a dozen declarations.
  • Errors you can act on. A source that cannot be read raises a DiagramError with the line, the column and, where there is one, a hint.

The syntax is a declared subset of Mermaid's and PlantUML's. What is supported is listed per diagram type in the documentation; anything else is an error rather than a silently wrong picture.

Documentation

| | English | Русский | Deutsch | 中文 | |---|---|---|---|---| | Getting started | en | ru | de | zh | | Flowchart | en | ru | de | zh | | Sequence diagram | en | ru | de | zh | | State diagram | en | ru | de | zh | | Entity relationship diagram | en | ru | de | zh | | Class diagram | en | ru | de | zh | | Pie chart | en | ru | de | zh | | Gantt chart | en | ru | de | zh | | Timeline | en | ru | de | zh | | XY chart | en | ru | de | zh | | Mind map | en | ru | de | zh | | Journey | en | ru | de | zh | | Quadrant chart | en | ru | de | zh | | Kanban board | en | ru | de | zh | | Requirement diagram | en | ru | de | zh | | Architecture diagram | en | ru | de | zh | | Sankey diagram | en | ru | de | zh | | Git graph | en | ru | de | zh | | Block diagram | en | ru | de | zh | | PlantUML | en | ru | de | zh | | Graphviz DOT | en | ru | de | zh | | D2 | en | ru | de | zh | | DBML | en | ru | de | zh | | Structurizr DSL | en | ru | de | zh | | Wardley map | en | ru | de | zh | | Theming | en | ru | de | zh |

Install

npm install @dskripchenko/diagrams

Node 20 or newer for server-side use; any current browser.

License

MIT. Security issues: see SECURITY.md.