There are trade offs to be sure, but I prefer the languages (and in this case platforms) that have batteries included.
Yes, this means that if your project depends on ten other projects, and all ten projects implement their own copy-file routine, your project will end up with ten copy-file routines.
When working on a project and you need to copy something for the first time, you shouldn't have to do:
* Ok I need to copy... What npm package does that again?
* search NPM for copy
* figure out which package is "best"
* npm i some-copy-package
* require("some-copy-packge")
* do thing
The first 4 steps should be unnecessary.fs.createReadStream('file.txt').pipe(fs.createWriteStream('new-file.txt'))
Streams are too slow you say?
fs.writeFileSync('new-file.txt', fs.readFileSync('file.txt'))
I've never had a problem with no explicit copy, but I am very happy it has been added...
In macOS libc there's a copyfile(3) function: https://developer.apple.com/legacy/library/documentation/Dar...