Skip to content

Instantly share code, notes, and snippets.

@mdedetrich
Created January 18, 2013 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdedetrich/f99b5d826d1012f23d80 to your computer and use it in GitHub Desktop.
Save mdedetrich/f99b5d826d1012f23d80 to your computer and use it in GitHub Desktop.
async.waterfall([
tmp.tmpName, function(path, cb) {
var fStream;
console.log(path);
fStream = fs.createWriteStream(path);
fStream.on('end', function() {
console.log('cheese');
fStream.end();
return cb(null, path);
});
return request('http://blogs.independent.co.uk/wp-content/uploads/2012/12/some-girls.jpg').pipe(fStream);
}
], function(err, res) {});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment