0.1.0 • Published 12 years ago
directory-copy
Licence
BSD
Version
0.1.0
Deps
3
Vulns
0
Weekly
0
Copy the contents of one directory to another, and leave behind specified exclusions.
Install
npm install directory-copy
Usage
var copy = require('directory-copy')
copy(options, cb)
optionsis an options hashsrcthe source directory (required)destthe destination directory (required)excludesan array of RegExp objects to.test()filenames against. If the test returns true, the file won't be copied.
cbis the callbackfunction (err) {}(erris null if ok)
copy() returns an event emitter that emits 'log' events.
Eg:
copy(
{ src: __dirname + '/source/static'
, dest: __dirname + '/output/static'
, excludes: [ /^\./ ] // Exclude hidden files
}
, function () {
console.log('done!')
})
.on('log', function (msg, level) {
// Level is debug, info, warn or error
console.log(level + ': ' + msg)
})
