I use https://pnpm.io whenever possible. It has many benefits, the main one is that the node modules are symlinked to one big repo in your home directory, so there isn’t nearly as much duplication.
NPMprune: Remove unnecessary files from node_modules to optimize storage
41–50 of 52 posts
Re: NPMprune: Remove unnecessary files from node_modules to optimize storage
#42Are people that concerned about the size of a directory on their machines?
Re: NPMprune: Remove unnecessary files from node_modules to optimize storage
#43I use https://pnpm.io whenever possible. It has many benefits, the main one is that the node modules are symlinked to one big repo in your home directory, so there isn’t nearly as much duplication.
Curious whether this works on Windows? Symlinks are strange there (though hard links work fine on NTFS).
As my ol' grandpappy used to say, "Why wonder? Let's go search the Internets!"
Re: NPMprune: Remove unnecessary files from node_modules to optimize storage
#44Can someone explain to me why this is even necessary? I have at the time of this comment, 32 node projects on my machine, all with their own node_modules, and I'm using less than 200GB (total, including everything else on my machine) of my total 1TB hard drive space... Are people that concerned about the size of a directory on their machines?
Re: NPMprune: Remove unnecessary files from node_modules to optimize storage
#45I use https://pnpm.io whenever possible. It has many benefits, the main one is that the node modules are symlinked to one big repo in your home directory, so there isn’t nearly as much duplication.
Was introduced at work and it's a game changer. The monorepo support (via "workspace:*") is absolutely clutch too.
Re: NPMprune: Remove unnecessary files from node_modules to optimize storage
#46I use https://pnpm.io whenever possible. It has many benefits, the main one is that the node modules are symlinked to one big repo in your home directory, so there isn’t nearly as much duplication.
Curious whether this works on Windows? Symlinks are strange there (though hard links work fine on NTFS).
Re: NPMprune: Remove unnecessary files from node_modules to optimize storage
#47This is wildly unsafe. - Some packages contain non-JS files for good reasons, and they may break in subtle unpredictable ways when you mess with the contents of their package. - Node.js will happily run JavaScript files even if they're not "*.js": A file like "hello.alsdfhlshdfl" works just fine as long as its content parses. There is no guarantee that your dependencies (and their recursive dependencies) don't static…
Re: NPMprune: Remove unnecessary files from node_modules to optimize storage
#48Earlier quoted context omitted.
Curious whether this works on Windows? Symlinks are strange there (though hard links work fine on NTFS).
If you don't want to risk adding something nefarious to your Google history, DuckDuckGo is a nice alternative. As my ol' grandpappy used to say, "Why wonder? Let's go search the Internets!"
Re: NPMprune: Remove unnecessary files from node_modules to optimize storage
#49I use https://pnpm.io whenever possible. It has many benefits, the main one is that the node modules are symlinked to one big repo in your home directory, so there isn’t nearly as much duplication.
Curious whether this works on Windows? Symlinks are strange there (though hard links work fine on NTFS).