Make vscode understand p5js

I prepared a ready-to-use zip-file with the newest version of P5JS and the typescript definitions referenced already. Download > Unpack > Open With Code > Done.

I also blogged about this solution in more depth, if you want to know more.

Edit December 2021: Updated the ready-to-use zip-file to the newest version pf P5JS.


As far as Intellisense for P5.js in Visual Studio Code is concerned, there is currently no official build of p5.js typescript definition files, hence it cannot be done with npm install. I have attached a link to a zip file (as stack overflow doesn't support file attachment):

https://www.filehosting.org/file/details/795689/p5.d.zip

After download, put them in your project directory somewhere and add a reference to them in your sketch.js file.

E.g:

< reference path="./p5.global-mode.d.ts" / >

After that you will be able to get autocomplete & docs:

enter image description here