Twitter | Search | |
Stefan Judis
Hah - just read a solid article about `npm ls` ( - thx 👏) and learned that you can use `npm ls` with an additional package name argument to figure out how many times it is included in your dependency tree. 🎉
Reply Retweet Like More
Tierney Cyren Apr 29
Replying to @stefanjudis
Glad I was able to help! \o/
Reply Retweet Like
Mr. Corvi Apr 29
It comes batteries included... But I had a perfectly good unix pipeline & awk script
Reply Retweet Like
Manu Romero Apr 29
I think if you do: npm ls package | grep package | nc -l You get the number of times
Reply Retweet Like
Tierney Cyren Apr 29
What does nc -l do?
Reply Retweet Like
Manu Romero Apr 29
Sorry, I meant wc -l
Reply Retweet Like
Tierney Cyren Apr 29
this is also super useful for figuring out how many deduped modules you've got! thank you for sharing <3
Reply Retweet Like
Manu Romero Apr 29
You are welcome. And the master here 😉
Reply Retweet Like
Jason Barone Apr 29
Ah, nice! And yarn list works like that too. Thanks 🤙🏻
Reply Retweet Like