3 ms·
But why should isOdd, isEven and isNumber reside in seperate packages? Surely a single math tools package should cover all of this?
by rozab 6y ago
But why should isOdd, isEven and isNumber reside in seperate packages? Surely a single math tools package should cover all of this?
- wongarsu 6y agoIt's an overreaction to the critizism of bloated libraries like JQuery. Dead code removal with tree shaking is a relatively recent feature in JS toolchains, so instead you have single-function libraries. For example there are also npm packages with each lodash function as its own package [1] 1: https://www.npmjs.com/search?q=keywords:lodash-modularized https://www.npmjs.com/search?q=keywords:lodash-modularized
- z3t4 6y agoThink of it like being able to pull any function from a global scope. eg. var/const foo = require("bar") Its one gigantic standard library.
- onion2k 6y agoSurely a single math tools package should cover all of this? They shouldn't. It's silly. You're right that there should be "math"[1], but while those things aren't part of the main JS ecosystem people write utility libraries and publish them. [1] There is, it's https://mathjs.org/ https://mathjs.org/. More people should use it.