Skip to main content
Home
This release is 2 versions behind 3.6.5 — the latest version of @q5/q5. Jump to latest

A sequel to p5.js that's optimized for interactive art

This package works with Node.js, Deno, Bun, BrowsersIt is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
70%
Published
a week ago (3.6.3)

Visit q5js.org! 💫

q5.js was designed to make creative coding fun and accessible for a new generation of artists, designers, educators, and beginners. 🤝

Familiar with p5? You'll be right at home with q5. It's like getting a free computer upgrade! 🖥️

createCanvas(100, 100);
circle(50, 50, 50);

Documentation

Browse the q5 reference pages to learn how to use q5.js.

See the wiki for extended documentation.

Use the q5.d.ts file in Visual Studio Code to get autocompletion and inline hover-over documentation. Simply add this jsconfig.json file to your project folder:

{
	"compilerOptions": {
		"target": "ESNext"
	},
	"typeAcquisition": {
		"include": ["node_modules/q5"]
	}
}

Support q5 💙

q5 is open source and anyone can use it for free under the terms of the LGPL (just like p5.js). 🎉

We need your support though! If you enjoy using q5.js, please donate via GitHub Sponsors, ko-fi, or Patreon.

Contributing

Are you interested in volunteering to write code for q5.js or improve the q5 ecosystem? Contributions are welcome!

Please report issues or comment on existing issues before working on a pull request. Check out the q5 project planning board.

All contributors must agree to the code of conduct.

Licensing

q5.js was created by the q5 team and is licensed under the LGPLv3. q5 is not affiliated with The Processing Foundation.

@LingDong- created the original q5xjs library which is Unlicense licensed.

p5.js is licensed under the LGPLv2, small sections of p5' code directly copied into q5 are credited below. The rest of q5 is a new implementation of part of the p5 API. APIs are not copyrightable in the United States, as decided by the Supreme Court in the Google v Oracle case.

Credits

WebGPU MSDF text rendering: https://webgpu.github.io/webgpu-samples/?sample=textRenderingMsdf

WebGPU blendMode: https://webgpufundamentals.org/webgpu/lessons/webgpu-transparency.html

HSLtoRGB: https://stackoverflow.com/a/64090995/3792062

HSBtoHSL: https://stackoverflow.com/a/66469632/3792062

OKLCHtoRGB: https://gist.github.com/dkaraush/65d19d61396f5f3cd8ba7d1b4b3c9432 https://github.com/color-js/color.js/blob/main/src/spaces/oklch.js

A JS Implementation of Ziggurat Algorithm: http://ziggurat.glitch.me/

p5.js Vector.slerp: https://github.com/processing/p5.js/blob/v1.10.0/src/math/p5.Vector.js#L2803

p5.js random: https://github.com/processing/p5.js/blob/1.1.9/src/math/noise.js

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@q5/q5

Import symbol

import * as q_ from "@q5/q5";
or

Import directly with a jsr specifier

import * as q_ from "jsr:@q5/q5";

Add Package

pnpm i jsr:@q5/q5
or (using pnpm 10.8 or older)
pnpm dlx jsr add @q5/q5

Import symbol

import * as q_ from "@q5/q5";

Add Package

yarn add jsr:@q5/q5
or (using Yarn 4.8 or older)
yarn dlx jsr add @q5/q5

Import symbol

import * as q_ from "@q5/q5";

Add Package

vlt install jsr:@q5/q5

Import symbol

import * as q_ from "@q5/q5";

Add Package

npx jsr add @q5/q5

Import symbol

import * as q_ from "@q5/q5";

Add Package

bunx jsr add @q5/q5

Import symbol

import * as q_ from "@q5/q5";