From ec87f5ae850f15f1b8ea64f341ea7fd651f412b2 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Fri, 13 Jan 2012 16:07:59 -0800 Subject: [PATCH] tweak png/jpeg stream examples in source --- lib/jpegstream.js | 8 +------- lib/pngstream.js | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/lib/jpegstream.js b/lib/jpegstream.js index 6c8157d..3e7ec93 100644 --- a/lib/jpegstream.js +++ b/lib/jpegstream.js @@ -21,13 +21,7 @@ var Stream = require('stream').Stream; * var out = fs.createWriteStream(__dirname + '/my.jpeg') * , stream = canvas.createJPEGStream(); * - * stream.on('data', function(chunk){ - * out.write(chunk); - * }); - * - * stream.on('end', function(){ - * out.end(); - * }); + * stream.pipe(out); * * @param {Canvas} canvas * @param {Boolean} sync diff --git a/lib/pngstream.js b/lib/pngstream.js index cb5461d..38e08cd 100644 --- a/lib/pngstream.js +++ b/lib/pngstream.js @@ -21,13 +21,7 @@ var Stream = require('stream').Stream; * var out = fs.createWriteStream(__dirname + '/my.png') * , stream = canvas.createPNGStream(); * - * stream.on('data', function(chunk){ - * out.write(chunk); - * }); - * - * stream.on('end', function(){ - * out.end(); - * }); + * stream.pipe(out); * * @param {Canvas} canvas * @param {Boolean} sync