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

figcraft

v0.2.0

Published

Code-driven SVG diagram library for TypeScript / Node.js. 10 shapes, 11 arrow heads, smart layouts, multi-format export, MCP integration.

Readme

Figcraft

Code-driven SVG diagram library for TypeScript / Node.js

By XFlow · Write a few lines of TypeScript, get publication-ready architecture diagrams.

npm version license node PRs Welcome

Website · Documentation · Install · GitHub


Highlights

| | Feature | | |---|---|---| | 10 Shapes | rect, circle, diamond, trapezoid, text, image, cylinder, cuboid, sphere, stack | 2D + 3D | | 11 Arrow Heads | triangle, stealth, vee, circle, diamond, bar, dot + open variants | Fully customizable | | Smart Layout | row() col() grid() group() | Auto-alignment | | Markdown Labels | **bold** *italic* `code` $math$ | In any element | | Multi-format | SVG, PNG, JPG, WebP, PDF | fit auto-crop | | MCP | AI agents generate diagrams via natural language | Claude / Cursor | | Zero Browser | Runs entirely in Node.js | Server-side ready |

Install

npm install figcraft        # npm
pnpm add figcraft           # pnpm
yarn add figcraft           # yarn

Requires Node.js 18+

Quick Start

import { Figure } from 'figcraft'

const fig = new Figure(800, 400, { bg: '#fff' })

const a = fig.rect('Input', {
  pos: [50, 100], size: [120, 50],
  fill: '#e3f2fd', radius: 6
})

const b = fig.rect('Output', {
  pos: [250, 100], size: [120, 50],
  fill: '#c8e6c9', radius: 6
})

fig.arrow(a, b, { head: 'stealth', label: 'data' })

await fig.export('diagram.svg', { fit: true, margin: 20 })
npx tsx diagram.ts

Elements

| Type | Method | Description | |:-----|:-------|:------------| | Rect | fig.rect() | Rounded rectangle | | Circle | fig.circle() | Circle | | Diamond | fig.diamond() | Decision node | | Trapezoid | fig.trapezoid() | Pooling / reduction | | Text | fig.text() | Markdown text label | | Image | fig.image() | Embedded image | | Cylinder | fig.cylinder() | 3D cylinder (database) | | Cuboid | fig.cuboid() | 3D cuboid (tensor) | | Sphere | fig.sphere() | 3D sphere | | Stack | fig.stack() | Multi-layer stack |

Arrows

fig.arrow(a, b)                                      // default
fig.arrow(a, b, { head: 'stealth', color: '#1565c0' }) // styled

// Anchors
fig.arrow(a, b, { from: 'right', to: 'left' })
fig.arrow(a, b, {
  from: { side: 'bottom', at: 30 },
  to: { side: 'top', at: 70 }
})

// Paths
fig.arrow(a, b, { path: 'curve', curve: 40 })
fig.arrow(a, b, { path: 'polyline', cornerRadius: 8 })

// Styles
fig.arrow(a, b, { style: 'dashed', bidirectional: true })

// Fan & Fork
fig.arrows(src, [a, b, c], { head: 'stealth' })  // fan-out
fig.fork(src, [a, b, c], { head: 'stealth' })     // shared trunk

Layout

fig.row([a, b, c], { gap: 40 })            // horizontal
fig.col([a, b, c], { gap: 30 })            // vertical
fig.grid([a, b, c, d, e, f], { cols: 3 })  // grid
fig.group([a, b, c], { label: 'Pipeline' }) // group box

Export

await fig.export('out.svg')                           // SVG vector
await fig.export('out.png', { fit: true, scale: 3 })  // high-res PNG
await fig.export('out.jpg', { quality: 95 })           // JPEG
await fig.export('out.webp')                           // WebP
await fig.export('out.pdf')                            // PDF

const svg = fig.render({ fit: true })                  // SVG string

MCP Integration

Let AI agents create diagrams for you. Add to Claude Code or Cursor config:

{
  "mcpServers": {
    "figcraft": {
      "command": "npx",
      "args": ["figcraft-mcp"]
    }
  }
}

Then just describe what you want in natural language.

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

Links

License

MIT — Made by XFlow