7 ms·
To be clear, this only depends on 1000 packages, seemingly because of a limitation of npm. What's actually pretty hilarious is that this probably isn't too far
by vladharbuz 6y ago
To be clear, this only depends on 1000 packages, seemingly because of a limitation of npm.
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. :)
- madjam002 6y agoThe project I’m working on now has 3,879 direct/indirect dependencies, beat that
- WanderPanda 6y agoIs that still considered "working", or already "battling"
- marcosdumay 6y agoHum? I've once reached 10k dependencies by just installing vue and a graphics plugin in an experiment.
- patates 6y agoIn my previous job, some PHP developers loved to pick on JS with that same accusation, then we checked the composer packages folder... Also, working with gradle now... I'd take the npm + webpack any day.
- jeltz 6y agoMaybe php has changed the last couple of years but the last time I worked with it the numbers of dependencies where nowhere near a typical node project.
- egeozcan 6y agoPHP has a standard library that's just incomparably larger than node's. That explains the number of packages. 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.
- jamesrom 6y agoIt appears to be the 1000 packages with the highest PageRank, as pulled from https://anvaka.github.io/npmrank/ https://anvaka.github.io/npmrank/ So it's safe to say that this package has the most transitive dependencies in npm.
- OskarS 6y agoIf you wanna do this bad boy for real, you depend on this one and the next 999 packages. Actually, this can become a fun optimization problem. Which 1000 packages do you depend on to cover as much of NPM as possible?
- madeofpalk 6y agoI thought that's what this was.
- koolba 6y agoMany of these packages have no dependencies. A new package that depends on this and anything not already downstream would have more dependencies.
- travisjungroth 6y agoMight get you close: 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.
- OskarS 6y agoYeah, that's the greedy algorithm and it will probably take you pretty far, but there's no guarantee that it's optimal. What if the package has lots of dependencies, but they are already covered by other packages. Do you kick other packages out? Which ones? Or is it better to keep them in and add some other packages? 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.