/p5js-test

Primary LanguageJavaScriptCreative Commons Zero v1.0 UniversalCC0-1.0

p5-electron-quick-start

Clone and run for a quick way to use P5js in Electron.

This quick start template allows you to quickly begin building P5js sketches in Electron. In addition to P5 and Electron, it comes pre-configured with:

  • Mocha as the Node.js test suite.
  • Electron-reload to keep the sketch up-to-date as you make changes.

In order to keep P5 out of the global scope, it is instantiated inside sketch.js. This means that whenever you would call a p5 method, you must call it from the injected p5 instance. For example, in the sketch function, you must use p.ellipse() rather than just ellipse.

To Use

To clone and run this repository you'll need Git and Node.js (which comes with npm) installed on your computer. From your command line:

# Clone this repository
git clone https://github.com/electron/electron-quick-start
# Go into the repository
cd electron-quick-start
# Install dependencies
npm install
# Run the app
npm start

Note: If you're using Linux Bash for Windows, see this guide or use node from the command prompt.

To Test

This quick start template employs MochaJS as the test framework. To run tests inside the test folder from your command line:

# Install dependencies
npm install
# Run the tests
npm test

Resource for Learning P5

Resources for Learning Electron

License

CC0 1.0 (Public Domain)