Skip to content

Commit

Permalink
doc: add missing semicolons
Browse files Browse the repository at this point in the history
PR-URL: nodejs/node-v0.x-archive#8498
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
  • Loading branch information
stevemao authored and trevnorris committed Oct 8, 2014
1 parent f04f3a0 commit 6e4bd49
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions doc/api/stream.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand All @@ -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);

Expand Down Expand Up @@ -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
Expand All @@ -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'
Expand All @@ -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.');
});
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -307,7 +307,7 @@ readable.on('data', function(chunk) {
console.log('now data will start flowing again');
readable.resume();
}, 1000);
})
});
```

#### readable.isPaused()
Expand Down

0 comments on commit 6e4bd49

Please sign in to comment.