As you probably know, NPM is a pretty easy meme target, unless you avoided the internet for the last couple of years. The promise is that you include ten things, ten things depend on five things, five things depend on ten things and the next thing is that you have half a gigabyte of node modules on your disk.
NPM is essentially unrestricted and even more than on wikipedia anyone can publish anything. This can even lead to a point where you publish something that is meant to be a joke and people actually start depending on it. One example where unnecessary dependencies have been dangerous is leftpad, a library that prepended a number of characters to a string. Its removal led to outages all over the internet.
This library is used to find out if (yep, actually) a number is equal to ten thousand.
Funny enough, is-ten even states how it is used by 10x engineers ;)
This library is very straightforward to use and it does exactly what you would expect:
It ‘owoifies’ (Hello -> Hewwo) your text.
const owoify = require('owoifyx'); console.log(owoify('Hello friend!')); // Hewwo fwiend (*^ω^)
26 people this week decided that they would need exactly this in their project.
The super clean three lines of code were developed by nine contributors in 30 commits, and like every good package, it has 100% test coverage. You might think: Why not use the built in constant ‘true’? - Uhm.. I don’t know!
More than 300 people couldn’t live without this core utility this week.
There is also a companion package false which does exactly the same for false.
As one would expect, this returns the poop emoji, but what is really great about this piece of code is that this also has a 100% test coverage and therefore will - guaranteed! - return the poop emoji.
11 people this week used it, maybe to prove a point?
For all of you who might have wondered if you could also check if a number is even? Surprise - this package exists (is-even) and was downloaded more than 100k times this week.
Fun fact: After some investigation by the Codesphere experts, we found that it imports the is-odd package, and negates it to your convenience.
Many thanks for reading this post, hope you liked it! What's your favorite NPM package?