p5.js Libraries for Automatic Inclusion

The p5-server command-line tool, and the P5 Server Visual Studio Code extension, automatically include these libraries when a sketch uses a function or p5 property that they define. See automatic library includes for more information.

Each library is listed with the symbols (functions, classes, and variables), and the p5 properties, that it defines. A JavaScript-only sketch that uses one of these symbols or properties, and does not define it, causes the inclusion of the library that defines that symbol.

This page is generated from the files in this directory.

Core Libraries

The “Core” libraries from the official p5.js Libraries page.

This category includes only the p5.sound library. It does not include the p5.accessibility library because, as noted on that library’s home page, it is obsolete.

p5.sound

p5.sound extends p5 with Web Audio functionality including audio input, playback, analysis and synthesis.

Defines:

Community Libraries

“Community” libraries from the official p5.js Libraries page.

This category excludes a couple of libraries that could not be automatically included: .

ASCII Art

p5.asciiart is a simple and easy to use image-to-ASCII art converter for p5js.

Defines:

p5.ble.js

A javascript library that enables communication between BLE devices and a p5 sketch.

Defines:

p5.bots

With p5.bots you can interact with your Arduino (or other microprocessor) from within the browser. Use sensor data to drive a sketch; use a sketch to drive LEDs, motors, and more!

Defines:

p5.clickable

Event driven, easy-to-use button library.

Defines:

p5.cmyk.js

CMYK color space for p5.js

Defines:

p5.collide2D

A collision detection library for 2D geometry in p5.js

Defines:

p5.createloop

createLoop provides a simple and structured library for creating animation loops in the browser.

Defines:

p5.dimensions.js

p5.dimensions extends p5.js’ vector functions to work in any number of dimensions.

Defines:

p5.EasyCam

Simple 3D camera control with inertial pan, zoom, and rotate

Defines:

p5.experience.js

Extensive library for p5.js that adds additional event-listening functionality for creating canvas-based web applications

Defines:

p5.func

p5.func is a p5 extension that provides new objects and utilities for function generation in the time, frequency, and spatial domains

Defines:

p5.geolocation

p5.geolocation provides techniques for acquiring, watching, calculating, and geofencing user locations for p5.js.

Defines:

grafica.js

grafica.js lets you add simple but highly configurable 2D plots to your p5.js sketches.

Defines:

p5.gui

p5.gui generates a graphical user interface for your p5.js sketches.

Defines:

p5.localmessage

p5.localmessage provides a simple interface to send messages locally from one sketch to another for easy multi-window sketching

Defines:

marching

Raster to vector conversion, isosurfaces

Defines:

Mappa

Mappa provides a set of tools for working with static maps, tile maps, and geo-data. Useful when building geolocation-based visual representations

Defines:

ml5.js

A friendly machine learning library for the web.

Defines:

p5.play

p5.play provides sprites, animations, input and collision functions for games and gamelike applications

Defines:

p5.particle

The Particle and Fountain objects can be used to create data-driven effects that are defined through user structures or JSON input and user-draw functions

Defines:

p5.Riso

p5.Riso is a library for generating files suitable for Risograph printing. It helps turn your sketches into multi-color prints

Defines:

RiTa

tools for generative natural language

Defines:

Rotating Knobs

Make knobs you can rotate with custom graphics and return value ranges

Defines:

p5.SceneManager

Helps you create sketches with multiple states / scenes

Defines:

p5js.screenPosition

p5js.screenPosition is a library that provides a function for getting the position of the mouse on the screen

Defines:

p5.scribble

Draw 2D primitives in a sketchy look

Defines:

p5.serial

p5.serial enables serial communication between devices that support serial (RS-232) and p5 sketches running in the browser

Defines:

Shape5

Shape5 is a library for creating and manipulating shapes in p5.js

Defines:

p5.shape.js

A library built to add more simple shapes to the p5.js framework.

Defines:

p5.speech

p5.speech provides simple, clear access to the Web Speech and Speech Recognition APIs, allowing for the easy creation of sketches that can talk and listen

Defines:

p5.start2d.js

p5 extension for 2D static art using px, mm, cm or inches

Defines:

p5.tiledmap

Add Tiled maps to p5.js.

Defines:

p5.touchgui

An easy-to-use touchscreen and mouse UI library for p5.js.

Defines:

vida

Vida is a simple library that adds camera (or video) based motion detection and blob tracking functionality to p5js

Defines:

p5.voronoi

p5.voronoi is a library for creating Voronoi diagrams in p5.js

Defines:

p5.xr

A library for p5.js that allows coders to easily render p5.js sketches in AR/VR using WebXR

Defines:

p5.3D

p5.3D is a library for creating 3D graphics 3D Text and Images in WebGL

Defines:

Peer Libraries

Libraries that are not specific to p5.js, but are particularly useful for p5 sketches.

anime

Anime.js (/ˈæn.ə.meɪ/) is a lightweight JavaScript animation library with a simple, yet powerful API.

Defines:

CCapture.js

A library to capture canvas-based animations at a fixed framerate

Defines:

dat.gui

dat.gui is a lightweight controller library for JavaScript. It provides a highly customizable user interface building block called dat.gui. It has no dependencies on other libraries. Use it to easily build powerful and flexible user interfaces.

Defines:

Recommended Libraries

Libraries that are not on the official p5.js Libraries page, but appear to be useful and well-maintained.

I’ve also included my own libraries from Oliver’s p5.js libraries.

p5.layers

Make it easier to use Graphics instances to make layers

Defines:

p5.patgrad

A p5.js library for adding gradients and repeating patterns to your sketches

Defines:

p5.pattern

A pattern drawing library for p5.js.

Defines:

p5.rotate-about

Add rotateAbout() and scaleAbout() functions to p5.js

Defines:

p5.vector-arguments

Modify the p5.js functions to accept Vector arguments

Defines: