3 ms·
In comparison to yarn 1, my experience of pnpm is basically that it's even quicker (because it's mainly just linking), and significantly more intuitive. My ment
by MrJohz 5y ago
In comparison to yarn 1, my experience of pnpm is basically that it's even quicker (because it's mainly just linking), and significantly more intuitive. My mental model of the node modules directory is that it's all of the direct dependencies of my project, with each of those dependencies having its dependencies in nested node modules directories. Practically, that's not true any more because of deduping, which does solve a lot of problems, but makes that mental model a lot more complex.
In pnpm, though, it just works like that, but without most of the problems because, rather than a deep nested directory structure, it's just your direct dependencies symlinked from a truly flat store into the right places, with their dependencies symlinked again from the same shared store.
I haven't tried yarn 2 as much yet, which I think is a similar attempt to solve the problems inherent to node modules, just in a more complex way. My intuition and initial experiences are that it feels more brittle than pnpm, which already has some problems if a dependency relies too much on the deduped structure that npm provides.