PHP: is_int($x) (alias of is_integer)
Python: isinstance(x, int)
Node.js[1]:
typeof val === "number" &&
(!(typeof value !== 'number' || value !== value || value === Infinity || value === -Infinity)) &&
Math.floor(val) === val
I think all supported Node.js versions now have Number.isInteger (via es262), but the is-integer package still gets a 200_000 downloads a week[2].[1]: https://github.com/parshap/js-is-integer/blob/master/index.j...
The real answer is for Node to have built-ins that handle this (which they now do for `isInteger`, but absent that, I love that there are these specific packages that have unit tests and a simple API. People scoff at things at `isPromise`[1], but it's reliably filling a super important niche that the language doesn't handle.
[1]: https://github.com/then/is-promise/blob/1d547300e780a4eca391...
Even when the language migrates to a standard (NumberisInteger), the remaining ecosystem keeps depending on this package.
Which is a shame. child_process + promises (and a couple of listeners) is really handy for orchestrating things in scripts.
I don't really do much web dev these days, but JS is really convenient for these sorts of things. I still use it for a lot of scripts.
- request, indicates that the built-in networking isn't working for everybody
- moment, the JS nor Node have very comprehensive Date manipulation
- express, again indicates that the built in networking library isn't working for everyone
- fs-extra, literally filling the gaps in the built-in fs package
- async, bluebird, these could easily be considered "standard library" material
If you're not changing anything else about the management of these packages, what's the advantage of having request or express as part of the "standard" library?
And if you are changing the management of these packages, then maybe that's the solution with or without expanding the core library?
I think that Java for example has similar defacto-but-not-actual "standard libraries" that correspond to many of these domains.
I'm not convinced that a larger "core" is addressing the root problem.
I happen to not like the design choices of many of those libraries you mentioned and choose to to use them.
Express is an entire web framework. What other ecosystems have you used which would ship with these sorts of libraries?