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

drawstic

v0.2.0

Published

Deterministic drawing engine with an LLM-optimized Recipe DSL — render icons, pixel art and graphics to PNG, SVG and JPEG from the CLI or as a library.

Readme

Drawstic

CI npm license: MIT

Drawstic (a play on drastic and draw deterministic) is a deterministic drawing engine. You describe an image in a compact, LLM-optimized Recipe DSL and Drawstic renders it — pixel-for-pixel identically on every machine — to PNG, SVG or JPEG.

  • Deterministic — bundled math and a pinned colour pipeline, no floating-point drift across platforms.
  • Token-efficient DSL — Recipes are designed for LLM agents to write and edit cheaply.
  • Zero runtime dependencies — ships as ESM, runs on Node ≥ 20, Bun and Deno.
  • CLI first — agents call it on the command line; a typed library surface is available too.

Agent skill

Drawstic's primary use case is LLM agents authoring and verifying Recipe files. Install the bundled product skill into your agent first:

npx skills add torbenkoehn/drawstic

For non-interactive setups that should install only the Drawstic product skill:

npx skills add torbenkoehn/drawstic --skill drawstic -y

Alternatively, tell your agent the following:

Install the Drawstic skill from GitHub: torbenkoehn/drawstic

Quickstart (CLI)

No install required — run it straight from the registry with your package manager's runner:

bunx drawstic render icon.drw#icon --out icon.png
# npm:  npx drawstic render icon.drw#icon --out icon.png
# pnpm: pnpm dlx drawstic render icon.drw#icon --out icon.png
# yarn: yarn dlx drawstic render icon.drw#icon --out icon.png

A Recipe (icon.drw):

draw circleIcon 16x16:
  pal:
    k = #1a1a1a
    r = #c04040
  bg #fff
  circle k 8:8 7
  circle r 8:8 5 fill

Render that drawing to PNG:

drawstic render icon.drw#circleIcon --out circle.png

CLI commands

drawstic check   <file> [--json]                     # parse + deep-validate a recipe
drawstic fmt     <file> [--check] [--json]            # canonical formatter
drawstic context <file> [--json]                      # agent-facing structural brief
drawstic build   <file> [--out <dir>] [--json]        # run every `export` (PNG/SVG/JPEG + sidecars)
drawstic render  <file>#<drawing> [--out <path>] [--stdout]
                 [--png@N] [--ascii] [--preview] [--silhouette]
                 [--grid N] [--diff <png>] [--mode pixel|smooth] [--json]
drawstic sheet   <file> [--all] [--cols N] [--png@N]  # labeled contact sheet for drawing families
                 [--out <path>] [--stdout] [--ascii] [--preview] [--json]

Every command accepts --json for stable diagnostic records; exit code is non-zero iff an error diagnostic was produced.

Library usage

Drawstic exposes one subpath per public module (no barrel). Import exactly what you need. Each subpath ships compiled ESM and .d.ts files from dist/.

import { Engine } from 'drawstic/engine'       // also the default: 'drawstic'
import { encodePngRgba } from 'drawstic/png'
import { writeFileSync } from 'node:fs'

const recipe = `draw icon 16x16:
  bg #fff
  circle #c04040 8:8 6 fill
`

const engine = new Engine(process.cwd())
const mod = engine.loadSource(recipe, '<memory>', 'icon.drw')
const entry = mod.definitions.get('icon')
if (entry?.kind !== 'draw') throw new Error('no drawing named icon')

const sprite = engine.renderDraw(entry, [], entry.definition.span)
writeFileSync('icon.png', encodePngRgba(sprite.data, sprite.w, sprite.h))

Public subpaths

| Import | Module | Highlights | |--------|--------|------------| | drawstic / drawstic/engine | evaluator | Engine, defaultBudget, LANGUAGE_VERSION | | drawstic/parser | parser | parse | | drawstic/lexer | lexer | lex | | drawstic/ast | AST | Module, Statement, Expression, node types | | drawstic/color | colour pipeline | Color, mix, oklch, parseHexColor, … | | drawstic/diagnostics | diagnostics | Diagnostic, DrawsticError, formatDiagnostic | | drawstic/values | runtime values | Sprite, Region, Path, transforms | | drawstic/framebuffer | framebuffer | Framebuffer | | drawstic/png | PNG codec | encodePngRgba, encodePngIndexed, decodePng | | drawstic/jpeg | JPEG encoder | encodeJpeg | | drawstic/svg | SVG writer | encodeSvg, encodePathSvg | | drawstic/preview | ASCII/ANSI preview | spriteToAscii, spriteToAnsi | | drawstic/fmt | formatter | format, formatDiff | | drawstic/build | export runner | buildModule, runExport | | drawstic/cli | CLI | main(argv) |

Documentation

The npm package includes the compact agent skill because it is part of the product surface for LLM agents. Full docs, examples and ADRs live in the repository and are intentionally excluded from the published package.

Development

Drawstic is built with Bun (≥ 1.3). See CONTRIBUTING.md.

bun install
bun test          # run the test suite
bun run lint      # Biome check
bun run typecheck # tsc --noEmit
bun run build     # emit dist/ (ESM + .d.ts)

License

MIT (c) Torben Koehn