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

@fazelstudio/mini-canvas

v0.1.0

Published

A small, dependency-free 2D canvas renderer powered by Rust and WebAssembly.

Readme

@fazelstudio/mini-canvas

Small, fast 2D canvas renderer for Node.js, Bun and edge runtimes. Zero runtime npm dependencies — the renderer is a Rust tiny-skia + fontdue core compiled to WebAssembly (~961 KB). Published to the @fazelstudio npm org with publishConfig.access: public.

import { createCanvas } from "@fazelstudio/mini-canvas";
import { writeFile } from "node:fs/promises";

const canvas = await createCanvas(320, 180, { background: "#fff" });
canvas.roundRect(20, 20, 280, 140, 18, "#2364aa");
canvas.fillRect(40, 55, 240, 45, "#f7c548");
await writeFile("card.png", canvas.toBuffer("png"));

The v0.1 foundation includes solid and rounded rectangles, strokes, paths, linear/radial gradients, transforms, clipping, PNG/JPEG image decoding, and fontdue-backed text. Text rendering rasterizes glyphs on demand and caches them per (character, size) so repeated text costs nothing after the first draw; text shaping follows the v1 scope: per-glyph advance widths with auto-shrink against maxWidth.

import { readFile, writeFile } from "node:fs/promises";
import { createCanvas } from "@fazelstudio/mini-canvas";

const canvas = await createCanvas(320, 220, { background: "#182033" });
const font = canvas.loadFont(await readFile("fixtures/fonts/FiraSans-Regular.ttf"));
canvas.setFont(font, 28).fillText("Welcome", 24, 48, "#ffffff");
canvas.clipCircle(160, 130, 70)
  .drawImage(await readFile("fixtures/images/photo.jpg"), 90, 60, 140, 140, "cover");
await writeFile("welcome.jpg", canvas.toBuffer("jpeg", 88));

The repository ships example fixtures (Fira Sans, SIL OFL 1.1, and a generated JPEG) under fixtures/; any TrueType/OpenType font or PNG/JPEG file works in their place.

Use measureText(text).width for width measurement; advance widths are cached (2048-entry LRU) so repeated measurement is cheap. Text shaping beyond advance widths (ligatures, kerning pairs), colored emoji remain application-level in v1; fillTextWrapped helper and CanvasPool/renderBatch are available for batch workloads.

import { createPooledCanvas, releasePooledCanvas } from "@fazelstudio/mini-canvas";
// Reuse canvas instances across 500 cards — no per-card alloc
const canvas = await createPooledCanvas(640, 360);
canvas.clear("#fff").roundRect(0,0,640,360,18,"#2364aa");
releasePooledCanvas(canvas);

Install: npm install @fazelstudio/mini-canvas or bun add @fazelstudio/mini-canvas
Benchmark: bun run bench:update auto-writes benchmarks/RESULTS.md (also BENCH_UPDATE=1 bun run test)
License: MIT — see LICENSE; third-party crates in THIRD-PARTY-LICENSES.md