Skip to content

Commit

Permalink
Pass file information along to transform functions.
Browse files Browse the repository at this point in the history
 - This is useful for times when you want dynamically transform files based on some logic.  For example, you're copying a file hierarchy, and want to instrument javascript files for code coverage, and compress images.
  • Loading branch information
Justin DuJardin committed Feb 9, 2013
1 parent 5f2cb1f commit d227a8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ncp.js
Expand Up @@ -90,7 +90,7 @@ function ncp (source, dest, options, callback) {
var readStream = fs.createReadStream(file.name),
writeStream = fs.createWriteStream(target, { mode: file.mode });
if(transform) {
transform(readStream, writeStream);
transform(readStream, writeStream,file);
} else {
readStream.pipe(writeStream);
}
Expand Down

0 comments on commit d227a8b

Please sign in to comment.