Created
August 26, 2014 20:15
-
-
Save mafintosh/9831f5601799c42e81a8 to your computer and use it in GitHub Desktop.
This file contains 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
var stream = tmpStream(function(filename, stat, cb) { | |
// do stuff | |
// when done call cb which will unlink filename | |
// plus emit 'finish' on stream (or 'error' if called with an error) | |
}) | |
stream.write('hello world') | |
stream.end() | |
stream.on('finish', function() { | |
// above callback was called | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment