Skip to content

Chosen Technologies

Stephan Max edited this page Aug 19, 2025 · 2 revisions

Node Package Management

We need a robust, fast, and space-saving package manager to allow p5.js mode users to install arbitrary external Node packages. We also want to store the central Electron dependency just once, regardless how many sketches a user creates and edits. Anything else will blow space requirements out of proportion.

Technologies Considered

  • npm
    • Pros
      • shipped with Node.js runtime
      • well-established
    • Cons:
      • performance (sequential installation of packages)
      • questionable npm audit messages
  • yarn
    • Pros:
      • faster installation through parallelized downloads
      • offline mirrors + Plug’n’Play (Yarn’s way to avoid re-installs of dependencies)
    • Cons:
      • complex and bloated configuration
      • unclear whether PnP works for all kinds of packages
    • Yarn with PnP is a strong runner-up that I will keep on my radar; I will concentrate on interfacing with pnpm, though, both because of time restrictions and because pnpm presents itself as that strong
  • pnpm
    • Pros:
      • main motivation is saving space
      • performance
      • for different versions of same dependencies only files that differ are stored
      • no ghost dependencies via non-flat node_modules folder structure
      • comes with more interesting features like pnpm recursive for project installs in batches and Node environment management (replaces tools like nvm or manual management of different Node runtimes)
    • Cons:
      • Haven’t found any for our use-case

PNPM

https://pnpm.io

  • Core mechanic: saving space by storing dependencies and version diffs in a central (configurable) content-addressable store
  • Gotcha: node_modules file structure is non-flat and only exposes explicit dependencies, i.e. a transitive dependency C in case of A → B → C is not automatically importable when A only explicitly lists B as dependency
    • This clean approach is by design
    • Fix by adding C as an explicit dependency or work around by hoisting C to top level of node_modules (same as how npm does it)
  • Interesting: pnpm leaves its core business by also doubling as a Node environment management tool via pnpm env

Clone this wiki locally