News for hackers. Stuff that matters.
Re:JavaScript Growing Pains: From 0 to 13,000 Dependencies by rozab on Sunday June 14, 2020 @11:37AM (#23518453)
But why should isOdd, isEven and isNumber reside in seperate packages? Surely a single math tools package should cover all of this?
Re:JavaScript Growing Pains: From 0 to 13,000 Dependencies by onion2k on Sunday June 14, 2020 @04:00PM (#23520828)
Surely 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/. More people should use it.

Re:JavaScript Growing Pains: From 0 to 13,000 Dependencies by wongarsu on Sunday June 14, 2020 @12:07PM (#23518777)
It'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

Re:JavaScript Growing Pains: From 0 to 13,000 Dependencies by z3t4 on Sunday June 14, 2020 @01:12PM (#23519391)
Think of it like being able to pull any function from a global scope. eg. var/const foo = require("bar") Its one gigantic standard library.