var passAll = require('101/pass-all')
var isPositive = require('is-positive')
var isInteger = require('is-integer')
module.exports = passAll(isPositive, isInteger)
You don't even want to know what the is-positive and is-integer modules look like.Software pundits have been saying how modern programming is just wiring together existing components for years; the node ecosystem has taken that to its illogical extreme.
https://github.com/tjmehta/is-positive-integer/blob/master/i...
And also, the more independent dependencies you have, the more that risk is compounded.
One place I work at has a node app product with 500 (!!) modules like this, all of which have their own submodules. There are so many files that a server with a bog-standard 8GB EXT4 / drive cannot handle both the installed module, and a replacement during deployment, due to INODE exhaustion (solution: bigger EXT4 or use xfs).
If you use an excessive amount of small modules, that's an error of the developer, not an inherent flaw in the platform/ecosystem.
https://www.npmjs.com/package/true
From the usage:
> Usage
> Simply require the true module. The export is a function which returns the Boolean value true:
> var t = require('./true') , myTrueValue = t(); console.log(myTrueValue === true); // Logs 'true'
I have found in my experience a pattern that repeats itself.
1) I find a language (B) that I think is great because it solves X problem with the language (A) previously being used.
2) I use that new language long enough that eventually I learn it's pitfalls and hate it.
3) Switch to language (C) because it fixes problems found in language (B).
Eventually this loops.
Where A was C++, and B was Python.
I think, ultimately, this just boils down to “know a lot of tools and use the right tool for the job”.
So it's more of a spiral. A straight line would be better, but I'll take progress in whatever form.
Sure there is TONS of not nice things about JS, but it's slowly evolving to be better(ES6 + Promises), and it's not going anywhere anytime soon.