Depends on Every Package in NPM
npmjs.com
npmjs.com
What's actually pretty hilarious is that this probably isn't too far off the number of dependencies an average Javascript project has.
`npm install vue-cli` installs 306 packages weighing in at 245MB. :)
Also, working with gradle now... I'd take the npm + webpack any day.
The size, OTOH, is usually in the same ballpark of a node project. If I import chrome from npm (for testing) in some way (directly or transitional), then node leaps ahead, when not, usually composer takes the lead.
So it's safe to say that this package has the most transitive dependencies in npm.
Actually, this can become a fun optimization problem. Which 1000 packages do you depend on to cover as much of NPM as possible?
A new package that depends on this and anything not already downstream would have more dependencies.
Until you have 1000
Find the package not included that adds the most deps
If it adds less than everything you have
Add it
Else
Kick out anything that adds less than that
And then make that a package and repeat as desired.This problem is almost certainly NP-complete (it's basically the the "set cover" problem from Karp's 21 NP-complete problems), so for something the size of NPM it's almost certainly infeasible. Your greedy version would probably get you a pretty nice result, though.
I’m not saying using other libraries is bad, but even when I write a script that uses over a thousand lines of hand written python and calls a dozen pandas functions I know that the actual loc to solve the problem is much larger, and wouldn’t even be possible without certain libraries.
If I can write monaLisa() and get a nice painting on canvas then that really was 1 LOC.
What line count doesn’t include is the weight of the dependency, which may or may not matter.
The apps I write I have to support for many years, so this dependency weight does concern me. By dependency weight I am more referring to the breadth of authors/maintainers and not the actual amount of code. When working in the Java/.NET worlds you still deal with a ginormous amount of dependency code, but they are one maintainer that is funded. The downside of monolithic dependencies is lack of flexibility and vendor lock in.
Now, if a package licensed as MIT includes a dependency on a package licensed as GPL, I don't know if that's a violation by the parent project owner because the parent package doesn't actually distribute the GPL code, but rather includes a reference to it, so that the installer running "npm install" fetches it.
But I would imagine that the end user who is pulling those packages and actually installing all the dependencies would be in violation because the final packaged code used to deliver the service actually contains the GPL code.