kadamwhite / p5-cli

An NPM-based CLI for creating and running P5.js projects.
MIT License
30 stars 3 forks source link

p5 init #14

Open mulderp opened 9 years ago

mulderp commented 9 years ago

Hi,

I was looking for an initcommand to start a new project. It should feel similar to a Yeoman generator providing:

index.html sketch.js

and possible a basic web server for dealing with socket communication.

brysonian commented 9 years ago

the basic server is there already and you can use it with or without an html file. For example if you have a js file with a setup and draw function defined, you can do:

p5 serve thecode.js

and it'll open up an http server that serves that file and wraps it in the necessary html.

mulderp commented 9 years ago

Nice, but if I want to add more javascript to the project or include more libs (e.g. http://p5js.org/reference/#/libraries/p5.dom ) it would be nice to edit the initial html.

Also, when using sockets or other messaging stacks, e.g. from this example https://github.com/lmccart/itp-creative-js/tree/master/Spring-2014/week6/04_socket_server - a basic server template would be helpful.

Well, the init function just comes to mind, because I usually do git init and divshot init for hosting static files.

brysonian commented 9 years ago

oh yeah for sure, just wanted to make sure you'd seen that functionality. FWIW, I think the dom and sound addons are included in the html the server generates.