Created
September 4, 2014 21:04
-
-
Save tmcw/1fa2efa9c93f57ad234b 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 out = fs.createWriteStream(__dirname + '/' + filename + ".png") | |
, stream = canvas.createPNGStream(); | |
stream.on('data', function(chunk){ | |
out.write(chunk); | |
}); | |
// can be | |
canvas.createPNGStream() | |
.pipe(fs.createWriteStream(__dirname + '/' + filename + ".png")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment