logoalt Hacker News

PaulHouleyesterday at 3:01 PM8 repliesview on HN

Would be nice if node packages could be packed up in ZIP files so to avoid the security/metadata tax for small file access on Windows.


Replies

MarleTangibleyesterday at 3:13 PM

The number of files in the node modules folder is crazy, any amount of organization that can tame that chaos is welcomed.

show 1 reply
Dangerangeryesterday at 3:37 PM

There are alternative package managers like Yarn that use zip files as a way to store each Node package.[0]

[0] https://yarnpkg.com/advanced/pnp-spec#zip-access

show 2 replies
buttsackyesterday at 6:58 PM

When npm decided to have per-project node_modules (rather than shared like ruby and others) and human readable configs and library files I think the goal was to be a developer friendly and highly configurable, which it is. And package.json became a lot more than that as a result, it’s been a great system IMO.

Combined with a hackable IDE like Atom (Pulsar) made with the same tech it’s a pretty great dev exp for web devs

show 1 reply
fmorelyesterday at 3:13 PM

I remember when Firefox started putting everything into jars for similar reasons.

https://web.archive.org/web/20161003115800/https://blog.mozi...

zadikianyesterday at 4:29 PM

Would accessing deps directly from a zip really be faster? I'd be a little surprised but not terribly, given that it's readonly on an fs designed for RW. If not, maybe just tar?

show 1 reply
MBCookyesterday at 3:47 PM

It’s insane to me that node works how it does. Zip files make so much more sense, I really liked that about Yarn.

pverheggenyesterday at 5:21 PM

You can always use virtualized Linux to avoid the NTFS penalty (WSL2, VS Code dev containers, etc.)

show 1 reply
sheeptyesterday at 3:23 PM

Would it work to run a bundler over your code, so all (static) imports are inlined and tree shaken?