summaryrefslogtreecommitdiff
path: root/doc/api/stream.md
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-12-10 13:27:32 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2018-12-17 17:14:35 +0100
commit50dd555910ed0338c35f27ee57e947b9ec95724c (patch)
tree73a0d59eb5b1087afa4c42bc667bb268f1a23b72 /doc/api/stream.md
parentbe3ae339360c9833a77ebf5772786d75b7a8dd78 (diff)
downloadandroid-node-v8-50dd555910ed0338c35f27ee57e947b9ec95724c.tar.gz
android-node-v8-50dd555910ed0338c35f27ee57e947b9ec95724c.tar.bz2
android-node-v8-50dd555910ed0338c35f27ee57e947b9ec95724c.zip
doc,lib,test: capitalize comment sentences
This activates the eslint capitalize comment rule for comments above 50 characters. PR-URL: https://github.com/nodejs/node/pull/24996 Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/stream.md')
-rw-r--r--doc/api/stream.md14
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/api/stream.md b/doc/api/stream.md
index 5a9e304dc0..e6b4ffcc24 100644
--- a/doc/api/stream.md
+++ b/doc/api/stream.md
@@ -118,8 +118,8 @@ that implements an HTTP server:
const http = require('http');
const server = http.createServer((req, res) => {
- // req is an http.IncomingMessage, which is a Readable Stream
- // res is an http.ServerResponse, which is a Writable Stream
+ // `req` is an http.IncomingMessage, which is a Readable Stream
+ // `res` is an http.ServerResponse, which is a Writable Stream
let body = '';
// Get the data as utf8 strings.
@@ -1195,7 +1195,7 @@ function parseHeader(stream, callback) {
stream.removeListener('readable', onReadable);
if (buf.length)
stream.unshift(buf);
- // now the body of the message can be read from the stream.
+ // Now the body of the message can be read from the stream.
callback(null, header, stream);
} else {
// still reading the header.
@@ -1930,7 +1930,7 @@ pause/resume mechanism, and a data callback, the low-level source can be wrapped
by the custom `Readable` instance:
```js
-// source is an object with readStop() and readStart() methods,
+// `_source` is an object with readStop() and readStart() methods,
// and an `ondata` member that gets called when it has data, and
// an `onend` member that gets called when the data is over.
@@ -1938,11 +1938,11 @@ class SourceWrapper extends Readable {
constructor(options) {
super(options);
- this._source = getLowlevelSourceObject();
+ this._source = getLowLevelSourceObject();
// Every time there's data, push it into the internal buffer.
this._source.ondata = (chunk) => {
- // if push() returns false, then stop reading from source
+ // If push() returns false, then stop reading from source
if (!this.push(chunk))
this._source.readStop();
};
@@ -2391,7 +2391,7 @@ For example, consider the following code:
// WARNING! BROKEN!
net.createServer((socket) => {
- // we add an 'end' listener, but never consume the data
+ // We add an 'end' listener, but never consume the data
socket.on('end', () => {
// It will never get here.
socket.end('The message was received but was not processed.\n');