5 ms·
It really depends (haha) on what it is. I needed to copy a file in npm scripts. can't use `cp` because that fails on windows. I looked on npm to copy a file. Fi
by greggman3 6y ago
It really depends (haha) on what it is. I needed to copy a file in npm scripts. can't use `cp` because that fails on windows. I looked on npm to copy a file. First hit 197 dependencies, 1170 files, 47000 lines of JavaScript.
all I needed was
const fs = require('fs');
fs.copyFileSync(process.argv(2), process.args[3]);
Taking 197 dependencies means 197 things that need updates several times a year at a minimum. Any of those updates could break my code, introduce a bug, add a vulnerability on top of the ones already in the packages. So it's not like adding more dependencies is magically free.
- hinkley 6y agoIn the interests of some sanity, I would like to say, all in one spot, that these are not mutually exclusive - You should absolutely use community-supported tools to solve your problems. - You should substitute idiomatic code for libraries. You have made an argument for the latter that does not detract from the former.
- greyhair 6y agoThis needs about 1000 upvotes. So much truth in so few words.
- benibela 6y agoCopying a file is really hard to implement Lots of things can go wrong when writing a file: https://danluu.com/deconstruct-files/ https://danluu.com/deconstruct-files/