p5.js

A JavaScript library for accessible creative coding: a sketch-style API for drawing, audio-visual and generative work in the browser. Part of Open-source motion studio: 20 repos.

Checked 2026-10-27 against the GitHub repository, its README, and the npm or PyPI registry where relevant.

RuntimeBrowser. Headless only through a headless browser.
How an agent drives itLibrary API in code. It loops on draw() against real time; frame-exact export needs a host that controls the loop.
LicenseLGPL-2.1 (GitHub license file license.txt). Weak copyleft: read the terms before bundling it into a closed product.
MaintenanceLatest release v2.3.4, 2026-09-25; a v2.4.0 release candidate tag exists; repo pushed 2026-10-27; not archived.

What it gives you

  • Input: setup() and draw() functions that call drawing primitives. Output: a canvas, optionally with sound and interaction.
  • A web editor, tutorials and a large library and example ecosystem.

Key differentiator

The most approachable generative-art API, with a community built around learning and accessibility. Source: README.

Pick something else when

PixiJS for performance-sensitive 2D scenes. Paper.js for vector geometry. two.js for a small multi-renderer 2D scene API. Raw Canvas 2D for simple output. See the 2D comparison.

Agent fit

Moderate. Easy for agents to write, since sketches are short, but the draw loop is clock-driven and the license differs from most of the list.

Overlap with the rest of the stack

Overlaps PixiJS and Paper.js.

Sources