DEV Community

Cover image for 10 useless NPM Package with millions of downloads
Jyotishman Saikia
Jyotishman Saikia

Posted on

10 useless NPM Package with millions of downloads

1. is-odd

Detect number is odd or not - 2M downloads/month πŸŽ‰
check number is odd or not

2. is-even

Detect number is even or not - 855k downloads/month πŸŽ‰

check number is even or not

3. upper-case

Convert a string to upper case - 27M downloads/month πŸŽ‰
converts a string to uppercase

4. is-number

Detect a number is number or not - 194M downloads/month
check if a number or not

5. store2

For storing and getting from localstorage - 9.7M downloads/month πŸŽ‰
store in localstorage

6. array-flatten

Flatten nested arrays - 103M downloads/month πŸŽ‰
javascript flatten array

7. split-string

Split a string at any desired position - 67M downloads/month
Split a string

8. is-boolean-object

Detects a value is boolean or not - 52M downloads/month
Detects a value is boolean or not

9. array-includes

Check if a value exists in an array or not- 52M downloads/month
array includes

10. ismobilejs

Detects if mobile or not in browser or server - 170k download/week πŸŽ‰
detect mobile or not using javascript

If you know any other such useless plugin , please comment down below.

Also I have started posting on twitter related to frontend tips and tricks. You can follow me at- https://twitter.com/frontend_jsx

Latest comments (107)

Collapse
 
itsvinayak profile image
vinayak

You forget this npmjs.com/package/@_immo/return

It returns a value is

Collapse
 
rsickenberg profile image
Romain Sickenberg

🌈 Javascript in all his beauty ✨

Collapse
 
leob profile image
leob • Edited

The big question is of course, WHY?

Most of these packages are probably just Friday afternoon creations, vanity projects with the idea of "let's see how many downloads this sh*t will get" ...

But of course what's baffling is not that these packages exist or were ever created - what's crazy is that there are millions of people downloading this stuff, people with probably close to zero knowledge of Javascript, but who've learned how to google stuff.

Collapse
 
okikio profile image
Okiki Ojo

Some of those packages are actually valid and were created before a bunch of these features were added natively to js. In my mind only 3 of these packages are useless all the other packages have their place as well as their uses

Collapse
 
siddharthshyniben profile image
Siddharth

What about -? It has almost 23,000 downloads a week. I'm guessing people accidentally do npm i something - D. Next thing to do is make a package called --

Collapse
 
itsonglei profile image
SmingPro

may be …… create …… ( is_code ) …… haha …… so crazy

Collapse
 
boveru profile image
boverU

Why did you include is-number? This package does detect not only number format like 0-9, it recognizes other formats

Collapse
 
okyanusoz profile image
okyanusoz

Similar to array-flatten: npmjs.com/package/array-map

Collapse
 
ilia4bit profile image
ilia4bit • Edited

is-odd creation story:
once upon a time one genius accidentally write this code:
function isOdd(num) {
If (num % 2 == 1) {
return 'is odd'
}
}
and he realize that this function is unique and very helpful for programmers community so he create npm package
πŸ˜‚πŸ˜‚

Collapse
 
fijiwebdesign profile image
Gabirieli Lalasava

There is some use to all of these packages including is-even. That's for it's semantic value. They are trivial but not useless.

The first time you wrote is-even you had to search for it on Google, or yahoo/MSN search if you've been around that long. That's a tedious process with a lot of cognitive overhead. Understanding the modulo operator or using bitwise functions to do it.

Now an npm library proves it's weight by usage and popularity. It's has a lot more context than a search. So you can be sure it works just by the popular consensus and dependencies that hopefully work. This lessens the cognitive overload. It's basically a living code documentation with real world tests.

This can be shown by the new AI advancements like openai codex. From many useless/trivial pieces of code it can create context to create more code. Without the useless bits there isn't enough context for the larger bits.

If you come across modulo operator in a book or search, it takes a lot to grok it.

If you come across i%2 === 1 in arbitrary code you need a lot more context to understand what it does.

But if you see is_even() that gives more context.

Come across require('is-even') and that's getting very firm if you see that a couple thousand times. Multiply that by the contexts of code using it as a dependency and you get a pretty clear picture.

It's not just for AI. As a developer you make the same assumptions when you read code. And you learn faster from code with context.

Some of th best examples are now pretty redundant like many of the underscore, jquery etc. functions. They have made their way into the core language.

Collapse
 
tonymet profile image
Tony Metzidis
Collapse
 
jyotishman profile image
Jyotishman Saikia

package is deprecated

Collapse
 
tonymet profile image
Tony Metzidis

still 3m downloads and counting

Collapse
 
styfle profile image
Steven

xtend which is basically Object.assign()

Collapse
 
jyotishman profile image
Jyotishman Saikia

didnt know this exist. thanks for bringing to notice.

Collapse
 
nolawnchairs profile image
Michael Wieczorek • Edited

A few of these are from the same uber-prolific NPM account (sinderhous or something like that). I have an issue with such ludicrous packages for two reasons - one, it creates so many unnecessary items in the node_module dependency tree, and it seems like a cop-out of learning how to code in the first place.... take the is-odd and is-even packages - anyone who doesn't know how to use the modulus operator has no business coding an application, as that's fairly fundamental stuff.

Collapse
 
hmaina profile image
Hussaini Maina

Funny thing is that it takes less time to write the functions than to install and import them.

Collapse
 
jyotishman profile image
Jyotishman Saikia

thats true !

Collapse
 
sakethkowtha profile image
sakethk

Then i can plan npm package for addition, subtraction, multiplication, division πŸ€”

Collapse
 
jyotishman profile image
Jyotishman Saikia

haha! definitely you should try building them.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.