How to work locally with p5
If you want to work with p5.js on your computer, you need an editor.
The most simple one being text editor. There are also several code editors you can choose from, e.g. subethaedit, sublime text 2, brackets, atom, notepad++ just to name a few.
the html-page can look like this:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
The line <script src="forexample.js"></script> refers to the file forexample.js, which you work on in the editor. The necessary libraries can accessed directly by referencing to the online repositories. This also ensures that you always work with the most recent update. If you prefer to work with libraries downloaded directled from p5, you'll need to include these in the folder you are also storing your .js-file.