queued-copy-dir
v0.0.2
Published
Simple queued copy dir
Downloads
0
Readme
QueuedCopyDir
Installation
$ npm install --save queued-copy-dir
Usage
import * as qcd from 'queued-copy-dir'
/*
Synchronous
*/
try {
qcd.sync('/source/directory/name', '/destination/directory/name')
console.log('QCD successfully finished!')
} catch(err) {
console.log('QCD threw an error...')
console.error(err)
}
/*
With promises
*/
qcd.async('/src/dir/name', 'dest/dir/name')
.then(() => {
console.log('QCD successfully finished!')
})
.catch(err => {
console.log('QCD threw an error...')
console.error(err)
})
/*
With async/await
*/
try {
await qcd.async('/src/dir/name', 'dest/dir/name')
console.log('QCD successfully finished!')
} catch(err) {
console.log('QCD threw an error...')
console.error(err)
}