Hacker News new | ask | show | jobs
by jeroenhd 1358 days ago
> Like, let's introduce a dependency for decrement lol

Here's a package that basically does that: https://www.npmjs.com/package/number-precision

Not entirely unreasonable as all `number`s are floats by default in JS, but the implementation of the entire package (https://github.com/nefe/number-precision/blob/master/src/ind...) is less than 100 lines of code and actually contains a method called "minus".

The very worst JS packages I've seen have got to be is-odd and is-even. 430,796 and 202,268 downloads every week, I kid you not!

1 comments

Seems like a perfect candidate for a drive by fix. If you see it in your dependency tree, fix it in the project that uses it.