Re:NPM – "is-even", 160k weekly downloads
by Fiahil on Tuesday November 16, 2021 @11:06AM
(#29242151)
is-odd dependency, is-number, has 52,783,048 weekly downloads. (https://www.npmjs.com/package/is-number)
[ Parent
| on HN ]
Re:NPM – "is-even", 160k weekly downloads
by jazzyjackson on Tuesday November 16, 2021 @11:28AM
(#29242456)
just bizarre considering javascript has isNaN, Number.isFinite, and Number.isInteger; I guess there's a style of development where you check if what you want to do exists in npm first, without thinking about what the language itself offers.
Re:NPM – "is-even", 160k weekly downloads
by toshgoodson on Tuesday November 16, 2021 @12:07PM
(#29243097)
it's not too bizarre when you consider no version of IE supports Number.isFinite or Number.isInteger.
Re:NPM – "is-even", 160k weekly downloads
by throw_m239339 on Tuesday November 16, 2021 @01:22PM
(#29244386)
> it's not too bizarre when you consider no version of IE supports Number.isFinite or Number.isInteger.
If you are extensively using nodejs libraries to target IE, then you have other problems than supporting Number.isFinite or Number.isInteger to deal with first, considering that IE doesn't support modern ES versions in anyway. You'd have to use shims,polyfills and whatnot at first place and transpile all that npm code into something IE can run.
This isn't a very good argument to add an "is-even" package.
Re:NPM – "is-even", 160k weekly downloads
by jazzyjackson on Tuesday November 16, 2021 @12:09PM
(#29243122)
but this is an npm package, would a client side application be importing this code? surely at that point you could just include some Number polyfill as well (but you're right I was only thinking of node)