Browse Source

Docs for PNGStream

v1.x
Tj Holowaychuk 14 years ago
parent
commit
08e04449aa
  1. 15
      lib/pngstream.js

15
lib/pngstream.js

@ -14,6 +14,21 @@ var EventEmitter = require('events').EventEmitter;
/**
* Initialize a `PNGStream` with the given `canvas`.
*
* "data" events are emitted with `Buffer` chunks, once complete the
* "end" event is emitted. The following example will stream to a file
* named "./my.png".
*
* var out = fs.createWriteStream(__dirname + '/my.png')
* , stream = canvas.createPNGStream();
*
* stream.on('data', function(chunk){
* out.write(chunk);
* });
*
* stream.on('end', function(){
* out.end();
* });
*
* @param {Canvas} canvas
* @api public
*/

Loading…
Cancel
Save