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

fuderu

v0.8.8

Published

High-performance canvas drawing library with a different approach to brush stroke rendering.

Readme


npm version Downloads License Docs

Features

  • Layer System – Full layer stack with visibility, opacity, and 16 blend modes.
  • Canvas API – Built-in Canvas wrapper for pointer drawing with layer support.
  • Standalone BrushBrush engine for custom integrations.
  • Smooth Interpolation – Adaptive brush spacing and Bezier smoothing.
  • Pressure Support – Real pen pressure with optional mouse/touch simulation.
  • Device-Pixel-Ratio Aware – Automatic HiDPI scaling with explicit document sizing.
  • Runtime Configuration – Update brush properties on the fly.
  • Image Brushes – PNG/WebP stamps with recoloring and rotation.
  • Rotation Modesfixed, flow, and random with smoothing, offset, and jitter.
  • Brush Dynamics – Opacity, flow, angle, roundness, blend mode, and filter support.
  • Eraser Mode – Built-in eraser with runtime toggle.
  • Undo/Redo – Full history stack with configurable depth.
  • Module System – Extensible with built-in dynamic shape, transparency, spread, and pattern modules.
  • TypeScript-First – Full type safety with framework-agnostic design.

Latest Release

0.8.8

  • Added professional layer stack with create, delete, duplicate, reorder, and active layer selection.
  • Per-layer visibility, opacity, and 16 blend modes (Normal, Multiply, Screen, Overlay, etc.).
  • Brush now draws directly into the active layer's canvas.
  • Layer compositing with renderLayers() hook.
  • Fixed layer UI interactions (no more dropdown/input flicker).

Installation

npm install fuderu

Quick Start

import { Canvas } from "fuderu";

const painter = new Canvas({
  canvas: "#canvas",
  document: {
    width: 1536,
    height: 1536,
  },
  pressureSimulation: true,
  brush: {
    color: "#000000",
    size: 20,
    spacing: 0.5,
  },
});

// Layer management
const layer = painter.createLayer("Sketch");
painter.setActiveLayer(layer.id);

painter.loadConfig({
  color: "#ff6b6b",
  size: 32,
  eraser: false,
});

painter.undo();
painter.redo();
painter.clear();

Layer System

Fuderu includes a full layer stack with Photoshop-like capabilities.

Layer Management

// Create a layer
const sketch = painter.createLayer("Sketch");

// Get all layers
const layers = painter.getLayers();

// Get active layer
const active = painter.getActiveLayer();

// Set active layer
painter.setActiveLayer(sketch.id);

// Update layer properties
painter.updateLayer(sketch.id, {
  name: "Final Sketch",
  visible: true,
  opacity: 0.8,
  blendMode: "multiply",
});

// Duplicate a layer
const copy = painter.duplicateLayer(sketch.id);

// Move layer (stack order)
painter.moveLayer(sketch.id, 0); // Move to bottom

// Delete a layer
painter.deleteLayer(sketch.id);

Blend Modes

Currently available blend modes:

| Mode | Description | | ----------- | ------------------------------------ | | source-over | Normal | | multiply | Darkens with underlying colors | | screen | Lightens with underlying colors | | overlay | Combines multiply and screen | | darken | Keeps darker colors | | lighten | Keeps lighter colors | | color-dodge | Brightens underlying colors | | color-burn | Darkens underlying colors | | hard-light | Strong overlay effect | | soft-light | Soft overlay effect | | difference | Subtracts colors | | exclusion | Similar to difference but softer | | hue | Uses hue of top layer | | saturation | Uses saturation of top layer | | color | Uses hue and saturation of top layer | | luminosity | Uses luminosity of top layer |

Flow And Opacity

  • Opacity – Stroke-level ceiling (0-1). Applied once per stroke.
  • Flow – Per-stamp alpha buildup. Lower flow = slower paint buildup.
  • Spacing-Aware Flow – Automatically compensates for dense stamp spacing.

Image Brushes

await painter.loadImage("/brushes/star.png");

painter.loadConfig({
  rotation: {
    mode: "flow",
    smoothing: 0.15,
  },
});

Transparent images can be used as brush stamps with recoloring and rotation.

Modules

import { Brush, DynamicShapeModule, SpreadModule } from "fuderu";

const brush = new Brush(canvas, {
  color: "#111111",
  size: 24,
});

brush.useModule(
  new DynamicShapeModule({
    sizeJitter: 0.4,
    sizeJitterTrigger: "pressure",
  }),
);

brush.useModule(
  new SpreadModule({
    spreadRange: 0.3,
    count: 3,
  }),
);

Built-in modules:

  • DynamicShapeModule – Size, angle, and roundness jitter
  • DynamicTransparencyModule – Opacity and flow jitter
  • SpreadModule – Position scatter
  • PatternModule – Pattern-based stamping

Status

Fuderu is currently pre-1.0. The core brush, canvas, pressure, image, eraser, and module systems are implemented, but public APIs may still change while the library stabilizes.

Validated with Vitest and jsdom tests.

See ROADMAP.md for the current stabilization plan.

License

MIT