Forrest logo
back to the p5 tool

p5:tldr:bc61f

p5: Create a new p5 collection.
$ p5 new ${collection_name}
try on your machine

The command "p5 new ${collection_name}" is used in the p5.js library to create a new p5.js sketch.

Here's a breakdown of each part of the command:

  • "p5 new": This is the command used to create a new p5.js sketch.
  • "${collection_name}": This is a placeholder for the name you want to give to your new p5.js sketch. You need to replace it with an actual name, without the curly braces "{}".

When you run the command with a valid collection name, it will create a new directory with that name and generate the necessary files and folders for a basic p5.js sketch. This includes an index.html file, a sketch.js file (where you can write your p5.js code), and additional folders for assets like images or sounds.

The purpose of this command is to quickly set up a new p5.js project with all the necessary boilerplate code and file structure.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the p5 tool