Permalink
Browse files

Pass file information along to transform functions.

 - 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...
1 parent 5f2cb1f commit d227a8b95cdce7706897674a8681590e412fd1c3 @justindujardin justindujardin committed Feb 9, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/ncp.js
View
2 lib/ncp.js
@@ -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);
}

0 comments on commit d227a8b

Please sign in to comment.