cp for node.js with stream
$ npm install stream-cp
var cp = require('./');
cp('test/fixture', 'test/expected', function(file) {
return 'prefix_' + file;
}, function(err) {
console.log('done');
});
the example code will bring a result like this:
cp(src, dst, map, callback)
Arguments
src
: source folder pathdst
: destnation pathmap
: the function which is used to map the original file names to new filenames.callback
: if error occured, it will passed to the callback function.
MIT © Leigh Zhu