From 6e4bd494a50c3dfd432a5a6dd4a13556443dfa79 Mon Sep 17 00:00:00 2001 From: Steve Mao Date: Fri, 3 Oct 2014 15:53:15 +1000 Subject: [PATCH] doc: add missing semicolons PR-URL: https://github.com/joyent/node/pull/8498 Reviewed-by: Trevor Norris --- doc/api/stream.markdown | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/api/stream.markdown b/doc/api/stream.markdown index eb62021bfe8169..5ffcef91456a59 100644 --- a/doc/api/stream.markdown +++ b/doc/api/stream.markdown @@ -65,7 +65,7 @@ var server = http.createServer(function (req, res) { // Readable streams emit 'data' events once a listener is added req.on('data', function (chunk) { body += chunk; - }) + }); // the end event tells you that you have entire body req.on('end', function () { @@ -80,8 +80,8 @@ var server = http.createServer(function (req, res) { // write back something interesting to the user: res.write(typeof data); res.end(); - }) -}) + }); +}); server.listen(1337); @@ -158,7 +158,7 @@ hadn't already. var readable = getReadableStreamSomehow(); readable.on('readable', function() { // there is some data to read now -}) +}); ``` Once the internal buffer is drained, a `readable` event will fire @@ -179,7 +179,7 @@ possible, this is the best way to do so. var readable = getReadableStreamSomehow(); readable.on('data', function(chunk) { console.log('got %d bytes of data', chunk.length); -}) +}); ``` #### Event: 'end' @@ -194,7 +194,7 @@ or by calling `read()` repeatedly until you get to the end. var readable = getReadableStreamSomehow(); readable.on('data', function(chunk) { console.log('got %d bytes of data', chunk.length); -}) +}); readable.on('end', function() { console.log('there will be no more data.'); }); @@ -266,7 +266,7 @@ readable.setEncoding('utf8'); readable.on('data', function(chunk) { assert.equal(typeof chunk, 'string'); console.log('got %d characters of string data', chunk.length); -}) +}); ``` #### readable.resume() @@ -286,7 +286,7 @@ var readable = getReadableStreamSomehow(); readable.resume(); readable.on('end', function(chunk) { console.log('got to the end, but did not read anything'); -}) +}); ``` #### readable.pause() @@ -307,7 +307,7 @@ readable.on('data', function(chunk) { console.log('now data will start flowing again'); readable.resume(); }, 1000); -}) +}); ``` #### readable.isPaused()