Great point. I always try to challenge myself: if a package is under 50 lines of code, I write it myself. It saves a lot of dependency hell down the road.
That is an excellent rule of thumb, Vijay! Writing those 50 lines yourself not only keeps your node_modules light, but it also ensures you actually know exactly what code is running in your app. Say no to dependency hell!