We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm trying to save an object in a json file and I want to use the fs node module to do this. How am I supposed to use node modules with p5.js? It keeps returning 'require is not defined'.
Answers
You have two issues here:
fs
is a server-side node module and won't run in the browser.It is however possible to prompt the user to save a file with saveJSON