src/index.js
function copyFile (src, dest) {
  return new Promise((resolve, reject) => {
    const read = fs.createReadStream(src);
    read.on('error', reject);
    const write = fs.createWriteStream(dest);
    write.on('error', reject);
    write.on('finish', resolve);
    read.pipe(write);
  })
}
function copyFile (src, dest) {
  return new Promise((resolve, reject) => {
    const read = fs.createReadStream(src);
    read.on('error', reject);
    const write = fs.createWriteStream(dest);
    write.on('error', reject);
    write.on('finish', resolve);
    read.pipe(write);
  })
}
function copyFile ( src , dest ) { return new Promise ( ( resolve , reject ) => { const read = fs . createReadStream ( src ) ; read . on ( 'error' , reject ) ; const write = fs . createWriteStream ( dest ) ; write . on ( 'error' , reject ) ; write . on ( 'finish' , resolve ) ; read . pipe ( write ) ; } ) }
copy file to dir
@param src
@param dest
@returns {Promise<any>}
copy file to dir