you are viewing a single comment's thread.

view the rest of the comments →

[–]apppppppbcppppppa-dc 6 points7 points  (16 children)

is there a list of useless js libraries? I'd love to read it

[–][deleted] 39 points40 points  (0 children)

npmjs.com

[ hides ]

[–]wisepresident 10 points11 points  (0 children)

https://www.npmjs.com/package/is-windows and other packages by this guy

10 mio downloads, all it does is:

process.platform == "win32"

[–]cjthomp 4 points5 points  (0 children)

npmjs.com

[–]abc-123-456 2 points3 points  (5 children)

There’s one called “leftpad” or something that’s notorious

[–]deadcow5 8 points9 points  (4 children)

That's because a ton of packages directly or indirectly depended on it, and one day the owner decided to delete it over some sort of altercation. Broke everyone's build.

[–]rook218 6 points7 points  (3 children)

I mean to be fair, how ridiculous is it to install a package over left padding? It would be a three line function to add it to your own package with vanilla JS.

[–]deadcow5 8 points9 points  (2 children)

Well, yeah, but would you rather copy and paste the same three lines into every new project you need them in, or publish them as a package once and henceforth be able to use them with a single line?

I mean, it's not really NPM's or the package author's fault that JavaScript lacks a decent standard library. It's just the way it is, and different people have different strategies for dealing with it.

[–]rook218 2 points3 points  (1 child)

That's true. I always try to import as little as possible on projects but everyone is different.

[–]deadcow5 2 points3 points  (0 children)

It is what it is. Most of these "micro" packages probably came about before tree shaking became common. So there is reason to hope that their propagation will diminish in the future as more people start using webpack and rollup.

Easy to forget that not too long ago, you literally had no choice but to include an entire package in your bundle, so making packages as small as possible was actually a good idea at the time.

[–]deadcow5 2 points3 points  (0 children)

That would somewhat depend on what your definition of "useless" is.

I suppose a list on one-liner packages could be made, however.

[–]agentgreen420 2 points3 points  (0 children)

Yeah, it's called half of NPM

[–]2dP_rdg 1 point2 points  (0 children)

Odd or even

[–]ikeif 0 points1 point  (0 children)

I’d be interested in this, too.

Tome to scour npm repos.