3 ms·
> It reads your package.json and writes to node_modules, just like other package managers, so you can replace: > ... > pnpm pnpm's flagship feature is global
by oefrha 3y ago
> It reads your package.json and writes to node_modules, just like other package managers, so you can replace:
> ...
> pnpm
pnpm's flagship feature is global deduplication of packages, so sadly bun's package manager doesn't seem to be a replacement. Is there any plan or intention to support pnpm-like disk saving? (I suppose not having to esbuild etc. everywhere already helps.)
That said, I'm very impressed with the speed of `bun add` with already cached packages. Literally instant.
- Cu3PO42 3y agoBun already supports that [0]. It is the default behavior on Linux, but can also be enabled on macOS. [0] https://bun.sh/docs/install/cache#saving-disk-space https://bun.sh/docs/install/cache#saving-disk-space
- oefrha 3y agoNice! I was looking at du(1) output on macOS which appears to indicate all files are duplicated. It probably just can’t tell the files are clonefile’d.
- Jarred 3y agoThere is a very obscure undocumented api in macOS for detecting if two files are equal block-by-block but yeah I don’t think most tools can tell when files are clonefile’d
- Cu3PO42 3y agoJust a note on your documentation: it says "this benefit does not extend to macOS" about saving disk space. I find that to be slightly misleading. Since arguably the most common FS for macOS is now APFS, it does save significant disk space unless one were to modify the node_modules files.
- thunderbong 3y agoAny chance of this coming to Windows? Most of our developers are on Windows systems.
- hiccuphippo 3y agoKeep track of this issue: https://github.com/oven-sh/bun/issues/43 https://github.com/oven-sh/bun/issues/43 According to that, the speed benefits will probably not be as noticeable in windows.
- lolinder 3y agoYou're jumping to conclusions: I just tried the package.json below, and bun's node_modules folder is smaller than pnpm's (3.9M with pnpm vs 3.4M with bun), and as a sibling noted, bun is also deduplicating globally. That, coupled with the fact that bun installs twice as fast when no packages are cached (634ms compared to 1.3s) and 100x as fast when all packages are cached (6ms to 639ms), I think it's fair to say that bun can replace pnpm. Here's the package.json I tried: { "dependencies": { "express": "^4.18.2" } }%
- cobbzilla 3y agoI had difficulty using Bun with Verdaccio, a private/local npm repository. I know it’s possible to get it to work, but I didn’t have time to fiddle all the bits. If Bun made this easier, I’d switch from pnpm immediately.