Template repo for p5.js desktop development. Create p5.js art scripts without needing any html or css! Once your art is done, bundle it down with the build command to get your minified js file, then distribute it however you'd like!
If you want to dive right into developing, here is a vscode profile to copy. It contains tools for p5 development such as spellcheck, a live canvas and shortcut for it, prettier, and more.
- Run your preferred package manager's install script to add packages
- Create a project folder in the src directory
- Create a sketch.mjs file in that directory
- Add any p5 global methods to the global space
- Example: window.setup = setup
- Start coding!
If you would like type checking in your code, update your jsconfig.json file to look like this:
{
"compilerOptions": {
"checkJs": true,
"allowJs": true,
"types": ["@types/p5/global.d.ts", "./types/window.d.ts"]
},
"include": ["./src/*/*.js", "./src/*/sketch.mjs"]
}