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

blotter.ts

v1.0.1

Published

A JavaScript API for drawing unconventional text effects on the web.

Readme

blotter.ts

A JavaScript API for drawing unconventional text effects on the web — GLSL-backed, batched into a single WebGL draw call, output to plain per-text canvases.

This is a modern TypeScript rewrite of bradley/Blotter: ESM-first, typed, tree-shakeable, with three as a peer dependency. The rendering architecture is unchanged; the API is new (see Migrating).

How it works

  • Texts sharing a material are measured, bin-packed into a single texture atlas, and rendered together in one WebGL draw call through your material's fragment shader.
  • Each text gets its own output <canvas> (via blotter.forText(text)), which copies its region out of the shared back buffer every frame.
  • The render loop uses requestAnimationFrame and a single shared WebGL context regardless of how many Blotter instances exist.
  • Rendered text is canvas output: not selectable, best for titles, headings, and graphic text — not body copy.

Install

npm install blotter.ts three

three >= 0.152 is a peer dependency.

Usage

import { Blotter, Text } from "blotter.ts";
import { ChannelSplitMaterial } from "blotter.ts/materials";

const text = new Text("Hello", {
  family: "serif",
  size: 120,
  fill: "#171717",
});

const material = new ChannelSplitMaterial();
const blotter = new Blotter(material, { texts: text });

blotter.forText(text)?.appendTo(document.body);
await blotter.ready;

Uniforms

Material uniforms are live — writing a value updates the running shader:

material.uniforms.uOffset.value = 0.1;

Per-text overrides go through the text's render scope:

const scope = blotter.forText(text);
scope.material.uniforms.uOffset.value = 0.2; // this text only

Updating texts

text.value = "Goodbye";        // triggers a rebuild automatically
text.properties = { size: 90 }; // ditto
await blotter.update();         // explicit rebuild; resolves when settled

Custom materials

A material is a Shadertoy-style mainImage fragment function. Use textTexture(uv) instead of texture2D to sample the text:

import { Material, shaders } from "blotter.ts";

const wobble = new Material({
  mainImage: /* glsl */ `
    ${shaders.noise3d}

    void mainImage( out vec4 mainImage, in vec2 fragCoord ) {
      vec2 uv = fragCoord / uResolution;
      uv.y += snoise(vec3(uv * 4.0, uGlobalTime)) * uAmount;
      mainImage = textTexture(uv);
    }
  `,
  uniforms: {
    uAmount: { type: "1f", value: 0.05 },
  },
});

Uniform types are "1f" | "2f" | "3f" | "4f" (float/vec2/vec3/vec4). Every material also receives uResolution, uGlobalTime, uTimeDelta, uBlendColor, and uPixelRatio. GLSL helper snippets (noise, easing, line math, …) are exported as strings from the shaders namespace.

Or subclass:

import { Material } from "blotter.ts";

export class WobbleMaterial extends Material {
  constructor() {
    super({ mainImage, uniforms: { uAmount: { type: "1f", value: 0.05 } } });
  }
}

Bundled materials

blotter.ts/materials ships the classic Blotter effects: ChannelSplitMaterial, FliesMaterial, LiquidDistortMaterial, RollingDistortMaterial, SlidingDoorMaterial.

Migrating from Blotter 0.1

| Legacy | Now | | --- | --- | | <script> + window.Blotter.* globals | Named ESM imports from blotter.ts | | Separate material <script> downloads | import { ChannelSplitMaterial } from "blotter.ts/materials" | | new Blotter.Text(...), new Blotter.Material() | new Text(...), new Material() | | thing.needsUpdate = true | blotter.update() / material.update() / automatic on text.value = | | blotter.on("ready", ...) | await blotter.ready (the event still fires) | | Blotter.Assets.Shaders.PI | import { shaders } from "blotter.ts" → shaders.pi | | Blotter._extendWithGettersSetters subclass protocol | class MyMaterial extends Material | | Bundled underscore/EventEmitter/Three custom build | Gone; three is a peer dependency |

Development

pnpm install
pnpm dev           # demo page (vite)
pnpm test          # unit + browser (WebGL) tests
pnpm typecheck
pnpm lint
pnpm build         # tsup → dist/

Browser tests run in headless Chromium via Playwright (pnpm exec playwright install chromium once).

Credits

Blotter was created by Bradley Griffith. Shader helpers adapted from Reza Ali's Fragment, atlas packing from Jake Gordon's bin-packing. See the upstream project for the full original credits.

License

MIT