Pure JavaScript copyFile function for node.js