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

p5.keyed

v1.1.0

Published

Keyframe animation for p5.js: set values at a few points in time and Keyed blends everything in between.

Readme

p5.keyed

Keyframe animation for p5.js. Set a value at a few points in time, and Keyed blends everything in between, with easing, paths, effects and events. p5.keyed is the p5.js version of Keyed for Processing.

👉 Documentation and Tutorial

let x;

function setup() {
    createCanvas(400, 400);
    Keyed.init().setDuration(2);

    x = Keyed.ofFloat()
        .key(0, 50)
        .key(1, 350)
        .key(2, 50);
}

function draw() {
    background(255);
    circle(x.value(), height / 2, 40);
}

Features

  • Any type: numbers, colors, p5.Vector, strings, booleans, quaternions, shapes, or your own classes and plain objects.
  • Easing: After Effects style influence, the usual presets, CSS-like cubicBezier(), steps, or any function.
  • Timelines: loop, play once, pause, scrub, change speed, play backwards, or run several clocks side by side.
  • Pins: retime many keys at once by moving a single point in time.
  • Events: markers and loop/finish callbacks.
  • Binding: let Keyed write animated values straight into your objects.
  • Paths: move along Béziers, splines and chained curves, in 2D or 3D.
  • Effects: wiggle, orbit, spring, lag, stop motion, grid snap, motion trails, or your own.
  • Composition: reusable, self-contained animations on their own timeline.
  • Export: frame-exact timing for saveGif() and saveCanvas().

Installation

p5.keyed is an add-on for p5.js 2.x. Load it from the CDN after p5.js:

<script src="https://cdn.jsdelivr.net/npm/p5@2/lib/p5.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/p5.keyed@1/lib/p5.keyed.min.js"></script>
<script src="sketch.js"></script>

Or install it with npm and load node_modules/p5.keyed/lib/p5.keyed.js, or import the ES module in a bundler:

npm install p5.keyed
import p5 from 'p5';
import { keyedAddon, Keyed } from 'p5.keyed';

p5.registerAddon(keyedAddon);

See the installation page for instance mode, global mode with a bundler and editor types.

Examples

The library comes with examples in the examples folder, grouped like the chapters of the tutorial. Build the library first, then serve the folder and open an example, e.g. examples/01_Basics/FirstKey/index.html:

npm install
npm run build
python3 -m http.server 8000

Development

Needs Node.js. The library is written in TypeScript (src/), the compiled files land in lib/.

npm install
npm run build        # lib/p5.keyed.js (script tag), .min.js, .esm.js and lib/types
npm run watch        # rebuild lib/p5.keyed.js on every change
npm test             # unit tests (vitest)
npm run typecheck

The documentation is built with MkDocs Material (mkdocs.yml, sources in mkdocs/). The sketches in it are live: they run the files in examples/.

uv sync
uv run mkdocs serve  # or: uv run mkdocs build

Tested with p5.js 2.0.0 to 2.3.4 and Node 20 and 24.

AI coding assistants were used to port Keyed to p5.js, including the tests, examples and documentation.