News for hackers. Stuff that matters.
Re:Never use a dependency that you could replace with an aft... by greggman3 on Tuesday August 11, 2020 @04:52PM (#24125842)
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.
Re:Never use a dependency that you could replace with an aft... by hinkley on Tuesday August 11, 2020 @05:41PM (#24126344)
In 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.

Re:Never use a dependency that you could replace with an aft... by greyhair on Wednesday August 12, 2020 @09:41AM (#24131973)
This needs about 1000 upvotes. So much truth in so few words.
Re:Never use a dependency that you could replace with an aft... by benibela on Wednesday August 12, 2020 @05:14PM (#24137070)
Copying a file is really hard to implement

Lots of things can go wrong when writing a file: https://danluu.com/deconstruct-files/