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

@swiftlysingh/excalidraw-cli

v1.1.0

Published

CLI for creating Excalidraw flowcharts programmatically

Readme

excalidraw-cli

Features

  • Text-based DSL for quick flowchart creation
  • JSON API for programmatic use
  • Auto-layout using ELK.js (Eclipse Layout Kernel)
  • Multiple flow directions: TB (top-bottom), BT, LR, RL
  • Programmable API for integration into other tools

Installation

Using the npm

npm i @swiftlysingh/excalidraw-cli

From Source (Local Development)

git clone https://github.com/swiftlysingh/excalidraw-cli.git
cd excalidraw-cli
npm install
npm run build
npm link  # Makes 'excalidraw-cli' available globally

Direct Usage (No Install)

# Run directly with node
node dist/cli.js create --inline "[A] -> [B]" -o diagram.excalidraw

Quick Start

Create from DSL

# Inline DSL
excalidraw-cli create --inline "(Start) -> [Process] -> {Decision?}" -o flow.excalidraw

# From file
excalidraw-cli create flowchart.dsl -o diagram.excalidraw

# From stdin
echo "[A] -> [B] -> [C]" | excalidraw-cli create --stdin -o diagram.excalidraw

DSL Syntax

| Syntax | Element | Description | |--------|---------|-------------| | [Label] | Rectangle | Process steps, actions | | {Label} | Diamond | Decisions, conditionals | | (Label) | Ellipse | Start/End points | | [[Label]] | Database | Data storage | | -> | Arrow | Connection | | --> | Dashed Arrow | Dashed connection | | -> "text" -> | Labeled Arrow | Connection with label |

Example DSL

(Start) -> [Enter Credentials] -> {Valid?}
{Valid?} -> "yes" -> [Dashboard] -> (End)
{Valid?} -> "no" -> [Show Error] -> [Enter Credentials]

Directives

@direction LR    # Left to Right (default: TB)
@spacing 60      # Node spacing in pixels

CLI Reference

Commands

create

Create an Excalidraw flowchart.

excalidraw-cli create [input] [options]

Options:

  • -o, --output <file> - Output file path (default: flowchart.excalidraw)
  • -f, --format <type> - Input format: dsl, json (default: dsl)
  • --inline <dsl> - Inline DSL string
  • --stdin - Read from stdin
  • -d, --direction <dir> - Flow direction: TB, BT, LR, RL
  • -s, --spacing <n> - Node spacing in pixels
  • --verbose - Verbose output

parse

Parse and validate input without generating output.

excalidraw-cli parse <input> [options]

JSON API

For programmatic flowchart creation:

{
  "nodes": [
    { "id": "start", "type": "ellipse", "label": "Start" },
    { "id": "process", "type": "rectangle", "label": "Process" },
    { "id": "end", "type": "ellipse", "label": "End" }
  ],
  "edges": [
    { "from": "start", "to": "process" },
    { "from": "process", "to": "end" }
  ],
  "options": {
    "direction": "TB",
    "nodeSpacing": 50
  }
}
excalidraw-cli create flowchart.json -o diagram.excalidraw

Programmatic Usage

import { createFlowchartFromDSL, createFlowchartFromJSON } from 'excalidraw-cli';

// From DSL
const dsl = '(Start) -> [Process] -> (End)';
const json = await createFlowchartFromDSL(dsl);

// From JSON input
const input = {
  nodes: [
    { id: 'a', type: 'rectangle', label: 'Hello' },
    { id: 'b', type: 'rectangle', label: 'World' }
  ],
  edges: [{ from: 'a', to: 'b' }]
};
const json2 = await createFlowchartFromJSON(input);

Examples

Here are some flowcharts created with excalidraw-cli:

Simple Flow

Simple Flow

iOS App Architecture

iOS App Architecture

LeetCode Problem Solving Flow

LeetCode Flow

Output

The generated .excalidraw files can be:

  1. Opened directly in Excalidraw (File > Open)
  2. Imported into Obsidian with the Excalidraw plugin
  3. Used with any tool that supports the Excalidraw format

License

MIT