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

@kookyleo/plantuml-little-web

v1.2026.2-3

Published

wasm-bindgen wrapper for plantuml-little — run PlantUML → SVG in the browser

Readme

@kookyleo/plantuml-little-web

Browser/Node wasm-bindgen wrapper around the plantuml-little Rust crate — converts PlantUML source to SVG strings without a JVM, with byte-exact parity to the upstream Java PlantUML for the supported diagram set.

The wasm itself delegates Graphviz layout to @kookyleo/graphviz-anywhere-web via a small JS bridge, so you install both:

npm install @kookyleo/plantuml-little-web @kookyleo/graphviz-anywhere-web

Usage

import { Graphviz } from '@kookyleo/graphviz-anywhere-web';
import { setup, convert, version } from '@kookyleo/plantuml-little-web';

// Load the Graphviz wasm and wire it into the plantuml-little-web bridge.
const graphviz = await Graphviz.load();
setup({ graphviz });

console.log('plantuml-little-web', version());

const svg = convert(`@startuml
class A { x: int }
class B { y: string }
A --> B
@enduml`);

document.body.insertAdjacentHTML('beforeend', svg);

convert(puml) is synchronous once the Graphviz wasm is ready; it returns the raw SVG string. Any error from the Rust converter surfaces as a thrown JS Error whose message is the Rust Display text.

API

  • convert(puml: string): string — render a .puml source to an SVG string.
  • version(): string — the crate version embedded into the wasm.
  • setup({ graphviz }) — install a Graphviz engine (anything exposing .layout(dot, format, engine)) as the backing renderer. Returns a disposer.
  • installGraphvizBridge((dot, engine, format) => svg) — install a raw Graphviz bridge function directly. Useful if you're not using @kookyleo/graphviz-anywhere-web.
  • hasGraphvizBridge(): boolean — check whether a bridge is installed.

How it works

Internally, plantuml-little-web contains the plantuml-little Rust converter compiled to wasm32-unknown-unknown. The Rust code depends on graphviz-anywhere, whose wasm32 target delegates all layout calls to a global JS function globalThis.__graphviz_anywhere_render(dot, engine, format). The setup() / installGraphvizBridge() helpers are what install that global.

This keeps the wasm small (no C++ Graphviz linked in) and lets you share the Graphviz wasm runtime between multiple PlantUML-like libraries.

Node.js usage

Native ESM wasm imports currently require the --experimental-wasm-modules flag:

node --experimental-wasm-modules app.mjs

Bundlers (webpack 5, Vite, Rollup, esbuild, etc.) handle the wasm import natively — the package ships with "type": "module" and points exports["."] at the ESM entrypoint.

License

Same as plantuml-little: GPL-3.0-or-later OR LGPL-3.0-or-later OR Apache-2.0 OR EPL-2.0 OR MIT.