Background
Hello! I’ve actually got a few questions that pertain to the main point of the post. But for some background: Until September of this year, I’ve been coding with JavaScript in the p5.js Web Editor (a popular creative coding library/IDE) since 2021.
In September of this year, and in an attempt to take off the “training wheels” of my favorite pastime, I migrated my workflow to Visual Studio Code and installed extensions like Live Server and p5.vscode to emulate the behavior of the online editor (e.g., easy setup and automatic preview refresh). By copy-and-pasting the p5.js library into my VSC project, I could use Live Server’s local server feature to code anywhere regardless of internet connection, which I found extremely preferable over using a website to code.
In November, I discovered q5.js, a “spiritual successor to the p5.js and Processing graphics libraries.” It was built for the modern web, supporting WebGPU, including many new features, and clocking in at nearly 2% the size of p5.js, so of course I switched to using the former.
Question 1
To keep myself in-line with the “training wheels” idea that I shared above, should I use a dedicated JavaScript runtime environment?
I’ve heard so much about JavaScript runtimes like Node.js, Bun, and Deno. But I’ve done most of my research on Deno 2, as it appears to be analogous to q5.js, being a “spiritual successor” to Node.js. (Isn’t it true that virtually all serious JS developers use a JavaScript runtime? What’s the point? For my purposes, would using a runtime really help?)
Question 2
If using a JS runtime is worth it, how in the world would I actually use q5.js as a Node.js module or Deno dependency in VSCode?
Having tinkered around with Node.js and npm, I could never get the same behavior of copy-and-pasting q5.js into my project and including it in the index.html
file.
Question 3
To again “shed the training wheels”, should I start using TypeScript instead of JavaScript for my projects?
Eventually, I’d like to use TypeScript entirely, as again it appears to be analogous to q5.js in being a “spiritual successor” to JavaScript, adding type-checking, enumerations, and more features that I’d find super handy. (Also, q5.js and Deno provide full support for TypeScript.)
Conclusion
I’m all over the place and I apologize, but no amount of searching the internet and consulting ChatGPT could replace the helpfulness of interactions between real people on this platform. If you have any clarifying questions as to what I’m asking, I’d be happy to answer! Any help at all will be greatly appreciated. Thanks in advance!