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

@texel/yyz-core

v0.1.0

Published

Agnostic engine for creative-coding sketches (the core of yyz)

Readme

@texel/yyz-core

The agnostic engine behind yyzzero runtime dependencies, plain modern ESM JavaScript (types via JSDoc‑generated .d.ts).

It owns the sketch lifecycle, the timeline/sizing/filename/params math, and the Host / Surface / Sink seams. It never touches window / document / Deno / node: — every platform interaction is injected.

Entries

  • @texel/yyz-corecreateSketch(module, host, runtime?), the pure helpers (createTimeline, computeSize, resolveFilename, convertDistance, resolveParams, logParams, resolveEncoder, …), the seam types, the headless default Host, and create2dSurface / webgpuSurface (shared by every platform).
  • @texel/yyz-core/web — the browser Host (rAF, devicePixelRatio, viewport fit, keyboard shortcuts, download sink) plus the browser 2d/webgpu surface resolver.

Authoring a sketch

A sketch module exports a sketch factory and (optionally) a settings object:

export const settings = { dimensions: [1080, 1080], animate: true, duration: 4 };

export function sketch(props) {
  // setup runs once; closure-held state lives here
  return ({ context, width, height, playhead }) => {
    context.fillStyle = "#111";
    context.fillRect(0, 0, width, height);
    context.fillStyle = "#e54";
    context.beginPath();
    context.arc(
      width / 2,
      height / 2,
      width * 0.2 * (1 + Math.sin(playhead * 2 * Math.PI)),
      0,
      Math.PI * 2,
    );
    context.fill();
  };
}

The factory may return a render function, a hooks object ({ tick, render, resize, begin, end, export, teardown }), or nothing (a static one‑shot). tick advances state once per frame; render draws (and may run more than once per frame — resize, export, multi‑resolution). Render is sync by default; return a Promise to opt into async/incremental rendering (props.progress() for sub‑progress, props.raf() to yield portably, props.signal to cancel).

The usual entry is the CLI. To run standalone (no CLI), wire the host yourself:

import { createSketch } from "@texel/yyz-core";
import { browserHost } from "@texel/yyz-core/web";
import * as mod from "./sketch.js";

// boots, renders frame 0, and auto-plays when settings.animate; returns the live instance
const m = await createSketch(mod, browserHost(document.body));

Surfaces & export

settings.surface: "2d" (default) · "webgpu" · "svg" (a presented SVG surface — the browser host mounts a live <svg> as props.svg and mirrors returned markup on screen; degrades to data‑only off the DOM, e.g. Deno) · "none" / false (data‑only, e.g. SVG/JSON/gcode) · or a custom resolver. Exports are return‑value driven: return nothing for the default image, or { data, ext } (one or many) for arbitrary files.

A presenting surface may expose an optional present(result) seam: the engine calls it after each render with the latest return value so the surface can display it (the "svg" surface uses this for its text mode). It's display‑only and never affects export.

The Sink seam is a streaming frame consumer (begin → write → end): a per‑frame file sequence, or an encoder that finalizes one file (GIF via gifenc, mp4/webm via ffmpeg or WebCodecs). resolveEncoder(format, encoder, capabilities) picks the right one per environment, so --format=mp4 targets ffmpeg on the CLI and WebCodecs in the browser.

Status: v0 — canvas2d + webgpu + data surfaces all work; webgl is a possible future surface.