Skip to content

Installation

Terminal window
npm i sfn-diagram

The core package pulls in no browser engine or native rasterizer — SVG and Mermaid generation stay lightweight. PNG export uses @resvg/resvg-js, a native, browser-free rasterizer, provided by an optional peer dependency. Install it only if you use sfn-diagram/png:

Terminal window
npm i sfn-diagram @resvg/resvg-js
Terminal window
deno add jsr:@yusufaf/sfn-diagram

Every release ships standalone executables for Linux, macOS, and Windows, so the command line works without installing Node.js:

Terminal window
brew install yusufaf/tap/sfn-diagram

Or download a binary from the releases page and put it on your PATH. The binaries render SVG, Mermaid, and HTML; PNG export needs the native rasterizer, so use the Docker image or the npm package with @resvg/resvg-js for that. See Use from Python, Go, Java, and other languages for details and subprocess examples.