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

aidraw

v1.0.2

Published

AI-friendly CLI tool for creating hand-drawn style diagrams

Readme

aidraw

A CLI tool that generates hand-drawn style PNG diagrams from JSON input. Designed for AI coding agents to create visual diagrams programmatically.

Installation

npm install
npm run build

Usage

# Basic usage
aidraw diagram.json -o output.png --width 1920 --height 1080

# With custom config
aidraw diagram.json -o output.png --width 800 --height 600 --config myconfig.json

# From stdin
cat diagram.json | aidraw -o output.png --width 800 --height 600

Options

| Option | Required | Description | |--------|----------|-------------| | -o, --output <file> | Yes | Output PNG file path | | --width <pixels> | Yes | Output image width | | --height <pixels> | Yes | Output image height | | --config <file> | No | Config file (defaults to aidraw.config.json) |

JSON Input Format

{
  "elements": [
    { "type": "rectangle", "id": "box1", "x": 0, "y": 0, "width": 100, "height": 60, "label": "Hello" },
    { "type": "rectangle", "id": "box2", "x": 150, "y": 0, "width": 100, "height": 60, "label": "World" },
    { "type": "arrow", "start": "box1", "end": "box2" }
  ]
}

Coordinates use logical units. The diagram auto-scales and centers to fit the output dimensions.

Element Types

Shapes

All shapes support children[] for hierarchical composition. Child coordinates are relative to parent.

{ "type": "rectangle", "id": "r1", "x": 0, "y": 0, "width": 100, "height": 60, "label": "Box", "cornerRadius": 8 }
{ "type": "ellipse", "id": "e1", "x": 0, "y": 0, "width": 80, "height": 80, "label": "Circle" }
{ "type": "diamond", "id": "d1", "x": 0, "y": 0, "width": 80, "height": 80, "label": "Decision" }
{ "type": "container", "id": "group", "x": 0, "y": 0, "children": [...] }

Text

{ "type": "text", "text": "Hello World", "x": 50, "y": 100, "fontSize": 20, "fontFamily": "hand" }

Font families: hand (default), normal, code

Line

{ "type": "line", "points": [[0, 0], [50, 25], [100, 0]] }

Arrow

Arrows connect elements by ID. Connection points are calculated automatically.

{ "type": "arrow", "start": "box1", "end": "box2", "label": "connects" }

Arrow options:

  • startArrowhead / endArrowhead: null, "arrow", "dot", "bar" (default end: "arrow")
  • startSide / endSide: "top", "bottom", "left", "right", "auto"

Style Properties

Add a style object to any element:

{
  "type": "rectangle",
  "style": {
    "fill": "#a5d8ff",
    "stroke": "#1971c2",
    "strokeWidth": 2,
    "strokeStyle": "solid",
    "fillStyle": "solid",
    "roughness": 1,
    "opacity": 100
  }
}

| Property | Values | Default | |----------|--------|---------| | fill | hex color | "transparent" | | stroke | hex color | "#1e1e1e" | | strokeWidth | 1-4 | 2 | | strokeStyle | "solid", "dashed", "dotted" | "solid" | | fillStyle | "solid", "hachure", "cross-hatch" | "hachure" | | roughness | 0 (smooth) to 2 (rough) | 1 | | opacity | 0-100 | 100 |

Color Palette

Fills: | Color | Hex | |-------|-----| | Blue | #a5d8ff | | Green | #b2f2bb | | Yellow | #ffec99 | | Red | #ffc9c9 | | Purple | #d0bfff | | Gray | #dee2e6 | | Orange | #ffd8a8 | | Cyan | #99e9f2 |

Strokes: | Color | Hex | |-------|-----| | Black | #1e1e1e | | Blue | #1971c2 | | Green | #2f9e44 | | Red | #c92a2a | | Gray | #495057 |

Config File

Create aidraw.config.json:

{
  "background": "#ffffff",
  "padding": 20
}

Examples

Flowchart

{
  "elements": [
    { "type": "rectangle", "id": "start", "x": 0, "y": 0, "width": 120, "height": 50, "label": "Start", "cornerRadius": 25, "style": { "fill": "#b2f2bb" } },
    { "type": "diamond", "id": "check", "x": 0, "y": 80, "width": 120, "height": 80, "label": "Valid?" },
    { "type": "rectangle", "id": "yes", "x": 160, "y": 95, "width": 100, "height": 50, "label": "Process" },
    { "type": "rectangle", "id": "end", "x": 0, "y": 200, "width": 120, "height": 50, "label": "End", "cornerRadius": 25, "style": { "fill": "#ffc9c9" } },
    { "type": "arrow", "start": "start", "end": "check" },
    { "type": "arrow", "start": "check", "end": "yes", "label": "Yes" },
    { "type": "arrow", "start": "check", "end": "end", "label": "No" }
  ]
}

Architecture Diagram

{
  "elements": [
    {
      "type": "rectangle", "id": "frontend", "x": 0, "y": 0, "width": 200, "height": 120,
      "label": "Frontend", "style": { "fill": "#a5d8ff", "fillStyle": "solid" },
      "children": [
        { "type": "rectangle", "id": "react", "x": 25, "y": 50, "width": 150, "height": 40, "label": "React" }
      ]
    },
    {
      "type": "rectangle", "id": "backend", "x": 250, "y": 0, "width": 200, "height": 120,
      "label": "Backend", "style": { "fill": "#b2f2bb", "fillStyle": "solid" },
      "children": [
        { "type": "rectangle", "id": "api", "x": 25, "y": 50, "width": 150, "height": 40, "label": "API Server" }
      ]
    },
    { "type": "arrow", "start": "react", "end": "api", "label": "REST" }
  ]
}

Development

npm run dev              # Run with tsx
npm run build            # Build TypeScript
npm test                 # Run tests
npm run test:coverage    # Run tests with coverage