1. is-odd
Detect number is odd or not - 2M downloads/month π
2. is-even
Detect number is even or not - 855k downloads/month π
3. upper-case
Convert a string to upper case - 27M downloads/month π
4. is-number
Detect a number is number or not - 194M downloads/month
5. store2
For storing and getting from localstorage - 9.7M downloads/month π
6. array-flatten
Flatten nested arrays - 103M downloads/month π
7. split-string
Split a string at any desired position - 67M downloads/month
8. is-boolean-object
Detects a value is boolean or not - 52M downloads/month
9. array-includes
Check if a value exists in an array or not- 52M downloads/month
10. ismobilejs
Detects if mobile or not in browser or server - 170k download/week π
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)
You forget this npmjs.com/package/@_immo/return
It returns a value is
π Javascript in all his beauty β¨
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.
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
What about
-
? It has almost 23,000 downloads a week. I'm guessing people accidentally donpm i something - D
. Next thing to do is make a package called--
may be β¦β¦ create β¦β¦ ( is_code ) β¦β¦ haha β¦β¦ so crazy
Why did you include is-number? This package does detect not only number format like 0-9, it recognizes other formats
Similar to array-flatten: npmjs.com/package/array-map
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
ππ
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.
You forgot npmjs.com/package/left-pad
package is deprecated
still 3m downloads and counting
xtend which is basically
Object.assign()
didnt know this exist. thanks for bringing to notice.
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.
Funny thing is that it takes less time to write the functions than to install and import them.
thats true !
Then i can plan
npm
package foraddition, subtraction, multiplication, division
π€haha! definitely you should try building them.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.