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

@create-design/png

v0.1.5

Published

Deterministic, runtime-portable PNG projection and export for create-design documents

Readme

@create-design/png

Deterministic PNG projection for create-design documents. The package contains no DOM, Node built-in, native binary, timestamp, or random input, so the exact same API runs in a browser worker and in noninteractive Node.

const result = await exportPng(document, {
	scope: { kind: "active", artboardId: "artboard:page" },
	scale: 2,
	background: { kind: "transparent" },
})

Pixel contract

  • Output dimensions are max(1, round(artboard dimension × scale)).
  • Pixel centers are mapped evenly across the exact artboard rectangle; artwork is clipped at that rectangle.
  • The reference backend uses a fixed ordered 4 × 4 subpixel grid. Set samples to 1 or 2 when explicitly trading edge quality for throughput.
  • Paint follows the shared flattened layer/group order, with fill before stroke. Hidden layers are omitted, locked layers stay output-visible, and CMYK colors use the same deterministic sRGB alternate as SVG.
  • Open contours use the shared derived fill region (a straight endpoint closure) but retain authored open topology for stroke caps, joins, and dashes.
  • Valid live contour blends are lowered through the shared model projection; incompatible blends block output with the shared blend diagnostics.
  • Color and alpha use half-up 8-bit rounding. Partially covered transparent pixels are accumulated premultiplied and stored as straight RGBA.
  • Encoding is RGBA8, non-interlaced, filter 0, and deterministic stored-DEFLATE. Only IHDR, IDAT, and IEND are emitted; timestamps and ancillary metadata are intentionally absent.

The stable PngRasterBackend interface keeps orchestration independent of the reference renderer. A future accelerator must pass the byte, decoded-pixel, browser-worker, Node, lifecycle, and benchmark suites before becoming default.

Rasterizer appraisal

The initial implementation deliberately has no outside rasterizer. Native and WASM SVG engines offer higher throughput, but add platform binaries or WASM, browser/Node loading differences, a larger bundle, a second SVG interpretation layer, and additional license/provenance review. Canvas APIs are browser-only and vary by engine; native canvas and image libraries are not worker-portable. The pure TypeScript backend is MPL-compatible with this package, auditable from the repository, and produces identical bytes in every runtime. Its known cost is CPU time on large or high-scale artboards, so live proof is opt-in, debounced, cancellable, and yields between row batches.

Run pnpm --filter @create-design/png run profile for repeatable cold, warm, batch, and retained-heap measurements.