Created
January 24, 2016 06:12
-
-
Save ajduke/00966c74ea6a055b160f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
res= <destination file stream>; // It can be standard io, another file stream, etc | |
readStream = fs.createReadStream(filename); | |
readStream.on('open', function(){ | |
readStream.pipe(res); | |
}); | |
readStream.on('error', function(err){ | |
res.end(err); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment