bun icon indicating copy to clipboard operation
bun copied to clipboard

More space efficient, package manager

Open ulisses-cruz opened this issue 2 years ago • 3 comments

What is the problem this feature will solve?

Big node_module folder.

What is the feature you are proposing to solve the problem?

A similar approach to package management to pnpm. That could, probably, make bun even faster installing packages.

What alternatives have you considered?

No response

ulisses-cruz avatar Jul 11 '22 09:07 ulisses-cruz

It would definitely make it slower at installing.

It's something worth considering nonetheless, though I think there are better paths forward if willing to have an install mode that only maintains compatibility with Bun's runtime.

Specifically, I think it'd be interesting to just have a map of package names & versions to file paths. Then, you only have one version of a package installed on disk, without creating symlinks matching the hacky directory structure of node's module resolver implementation. The downside to an approach like this would be packages cannot edit the files

Jarred-Sumner avatar Jul 11 '22 09:07 Jarred-Sumner

It would definitely make it slower at installing.

Surely creating a symlink is faster than copying files?.

Using pnpm for me is way faster than npm for this very reason. And of course the disk savings are a bonus.

Saying this, isn't node module resolution backwards compatible in bun anyway, so there is no problems using pnpm and bun together, because workspace support is something I could not do without too.

KpjComp avatar Jul 12 '22 11:07 KpjComp

i need it too

pagongamedev avatar Feb 11 '23 01:02 pagongamedev

Disk space efficiency is at the same level of fast/speed. It's a great feature to consider. I'd love to fully migrate from pnpm to bun if we consider disk space also. My current solution using pnpm + bun is once in a while, I run npkill.

UPDATE 1: I found out here, it only affects macOS users. While Linux users use hardlink, it's fast and storage-friendly. Now, I want to experiment with Linux on macOS using OrbStack

UPDATE 2: I tested using bun 0.7.3 in Debian (bookworm, arm64) on macOS 14, and it seems the node_modules are still as heavy as black holes like npm. I decided to use pnpm locally, and for deployment (users love blazingly fast response) I'm using bun.

image

ImBIOS avatar Aug 18 '23 21:08 ImBIOS