Ls dcommand12/2/2023 If we check for deduped with a slightly modified grep command, we'll see that 21 dependencies were deduped. This time, npm ls shows that we have only 110 modules. if you care about what's going to production, it'd be nice to separate the dependencies that will be shipped to production from the devDependencies that are simply used to make your life as a developer easier.įrom running npm ls -production on the same project, we get a. Given this context, we know that there were 805 modules installed in total.īeing able to understand our dependency tree better is awesome! That said, npm ls by itself will tell you the current state of the entire node_modules directory. It's worth noting that every line with deduped is a module that didn't need to be installed because it was installed via another path that isn't marked as deduped. It turns out that of 1337 modules, 532 were successfully deduped. With my first-ever grep command ( grep deduped npm-ls.txt -c), I was able to find the total number of modules that were deduped: This means that npm was able to resolve a version of that module that met the requirements of multiple dependencies that require it to be installed. If you scroll through that list, you'll see a bunch of lines with deduped at the end. Yes, that's the real number with the module's current package.json – I'm just as surprised as you! See the full output in gist form here (it is too big to feel good about embedding it in this post!): īy just running npm install, I'll get 1337 modules in total. This command's output is 1339 lines long.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |