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

webgpu-brush

v3.0.0

Published

Pure-WebGPU fork of p5.brush (Alejandro Campos Uribe, MIT): custom brushes, natural fill effects and intuitive hatching, with GPU-resident geometry. Standalone build only — no p5.js dependency.

Readme

webgpu-brush

A WebGPU port of p5.brush by Alejandro Campos Uribe. Same drawing API, rendered on the GPU. No p5.js.

Install

Not on npm yet. Install from GitHub:

npm install github:lklyne/webgpu-brush

Use

import * as brush from 'webgpu-brush';

brush.createCanvas(700, 410, { parent: document.body });
brush.set('HB', '#2f2a26', 1.4);
brush.line(-200, -80, 200, 80);
brush.render();

three.js

webgpu-brush/three shares the renderer's GPUDevice and gives you a TSL node that samples the painting directly. No copies.

import * as THREE from 'three/webgpu';
import { attachToRenderer } from 'webgpu-brush/three';

const renderer = new THREE.WebGPURenderer({ canvas });
const att = await attachToRenderer(renderer, 1024, 1024);

const material = new THREE.MeshBasicNodeMaterial({ colorNode: att.node });
scene.add(new THREE.Mesh(new THREE.PlaneGeometry(2, 2), material));

att.brush.set('HB', '#2f2a26', 1.4);
att.brush.line(-300, -300, 300, 300);
att.brush.render();

att.brush is its own painting, with the full API. Call att.dispose() when done.

React Three Fiber

import * as THREE from 'three/webgpu';
import { Canvas, extend, useThree } from '@react-three/fiber';
import { useEffect, useState } from 'react';
import { attachToRenderer } from 'webgpu-brush/three';

extend(THREE);

function Painting() {
  const gl = useThree((s) => s.gl);
  const [att, setAtt] = useState(null);

  useEffect(() => {
    let live, cancelled = false;
    attachToRenderer(gl, 1024, 1024).then((a) => {
      if (cancelled) return a.dispose();
      live = a;
      a.brush.set('HB', '#2f2a26', 1.4);
      a.brush.line(-300, -300, 300, 300);
      a.brush.render();
      setAtt(a);
    });
    return () => { cancelled = true; live?.dispose(); };
  }, [gl]);

  return att && (
    <mesh>
      <planeGeometry args={[2, 2]} />
      <meshBasicNodeMaterial colorNode={att.node} />
    </mesh>
  );
}

export default () => (
  <Canvas flat linear gl={async (props) => {
    const renderer = new THREE.WebGPURenderer(props);
    await renderer.init();
    return renderer;
  }}>
    <Painting />
  </Canvas>
);

flat linear keeps the painting's colors 1:1 (no tone mapping, linear output).

Docs

  • Drawing API: p5.brush reference and p5-brush.cargo.site. Call everything on brush directly; there is no p5.
  • What's different: docs/standalone.md. Covers ready(), readPixels(), multiple paintings (createBrush()), the full three.js guide, GPU interop, snapshots and the hash RNG. Same seed ≠ same image as upstream.
  • Port history: FORK.md. Forked at v2.2.2 (fc37da3), upstream fixes synced through v2.2.3.

License

MIT