summaryrefslogtreecommitdiff
path: root/doc/api
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-03-07 01:03:53 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2019-03-10 00:44:40 +0100
commitf8763bb077db2f0be74e353c0b4f9e353c0fffa8 (patch)
treec73128074daa65d2e72e4d2a86a5b08059888144 /doc/api
parent01a5300f3f4f788a043f6b5fe72e2b7b641dfb6c (diff)
downloadandroid-node-v8-f8763bb077db2f0be74e353c0b4f9e353c0fffa8.tar.gz
android-node-v8-f8763bb077db2f0be74e353c0b4f9e353c0fffa8.tar.bz2
android-node-v8-f8763bb077db2f0be74e353c0b4f9e353c0fffa8.zip
benchmark,doc,lib,test: capitalize comments
PR-URL: https://github.com/nodejs/node/pull/26483 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/cluster.md2
-rw-r--r--doc/api/dgram.md4
-rw-r--r--doc/api/domain.md2
-rw-r--r--doc/api/errors.md6
-rw-r--r--doc/api/fs.md6
-rw-r--r--doc/api/http.md10
-rw-r--r--doc/api/http2.md4
-rw-r--r--doc/api/inspector.md2
-rw-r--r--doc/api/modules.md2
-rw-r--r--doc/api/net.md2
-rw-r--r--doc/api/perf_hooks.md4
-rw-r--r--doc/api/process.md2
-rw-r--r--doc/api/readline.md2
-rw-r--r--doc/api/stream.md10
14 files changed, 29 insertions, 29 deletions
diff --git a/doc/api/cluster.md b/doc/api/cluster.md
index 879f4af793..90e64239b3 100644
--- a/doc/api/cluster.md
+++ b/doc/api/cluster.md
@@ -237,7 +237,7 @@ if (cluster.isMaster) {
res.writeHead(200);
res.end('hello world\n');
- // notify master about the request
+ // Notify master about the request
process.send({ cmd: 'notifyRequest' });
}).listen(8000);
}
diff --git a/doc/api/dgram.md b/doc/api/dgram.md
index bb492b56c2..2d44074df8 100644
--- a/doc/api/dgram.md
+++ b/doc/api/dgram.md
@@ -27,7 +27,7 @@ server.on('listening', () => {
});
server.bind(41234);
-// server listening 0.0.0.0:41234
+// Prints: server listening 0.0.0.0:41234
```
## Class: dgram.Socket
@@ -172,7 +172,7 @@ server.on('listening', () => {
});
server.bind(41234);
-// server listening 0.0.0.0:41234
+// Prints: server listening 0.0.0.0:41234
```
### socket.bind(options[, callback])
diff --git a/doc/api/domain.md b/doc/api/domain.md
index 0f53e958bd..226eb660f4 100644
--- a/doc/api/domain.md
+++ b/doc/api/domain.md
@@ -420,7 +420,7 @@ d.on('error', (er) => {
});
d.run(() => {
process.nextTick(() => {
- setTimeout(() => { // simulating some various async stuff
+ setTimeout(() => { // Simulating some various async stuff
fs.open('non-existent file', 'r', (er, fd) => {
if (er) throw er;
// proceed...
diff --git a/doc/api/errors.md b/doc/api/errors.md
index b9d2642149..55ec282671 100644
--- a/doc/api/errors.md
+++ b/doc/api/errors.md
@@ -158,7 +158,7 @@ const fs = require('fs');
try {
fs.readFile('/some/file/that/does-not-exist', (err, data) => {
- // mistaken assumption: throwing here...
+ // Mistaken assumption: throwing here...
if (err) {
throw err;
}
@@ -217,7 +217,7 @@ a string representing the location in the code at which
```js
const myObject = {};
Error.captureStackTrace(myObject);
-myObject.stack; // similar to `new Error().stack`
+myObject.stack; // Similar to `new Error().stack`
```
The first line of the trace will be prefixed with
@@ -316,7 +316,7 @@ will not be present in the stack traces:
const cheetahify = require('./native-binding.node');
function makeFaster() {
- // cheetahify *synchronously* calls speedy.
+ // `cheetahify()` *synchronously* calls speedy.
cheetahify(function speedy() {
throw new Error('oh no!');
});
diff --git a/doc/api/fs.md b/doc/api/fs.md
index ea983a8c1c..8c629d02a4 100644
--- a/doc/api/fs.md
+++ b/doc/api/fs.md
@@ -1911,7 +1911,7 @@ console.log(fs.readFileSync('temp.txt', 'utf8'));
// get the file descriptor of the file to be truncated
const fd = fs.openSync('temp.txt', 'r+');
-// truncate the file to first four bytes
+// Truncate the file to first four bytes
fs.ftruncate(fd, 4, (err) => {
assert.ifError(err);
console.log(fs.readFileSync('temp.txt', 'utf8'));
@@ -3912,7 +3912,7 @@ async function doTruncate() {
await filehandle.truncate(4);
} finally {
if (filehandle) {
- // close the file if it is opened.
+ // Close the file if it is opened.
await filehandle.close();
}
}
@@ -3939,7 +3939,7 @@ async function doTruncate() {
await filehandle.truncate(10);
} finally {
if (filehandle) {
- // close the file if it is opened.
+ // Close the file if it is opened.
await filehandle.close();
}
}
diff --git a/doc/api/http.md b/doc/api/http.md
index 8a9d9bafda..b06a28e331 100644
--- a/doc/api/http.md
+++ b/doc/api/http.md
@@ -373,7 +373,7 @@ proxy.on('connect', (req, cltSocket, head) => {
// now that proxy is running
proxy.listen(1337, '127.0.0.1', () => {
- // make a request to a tunneling proxy
+ // Make a request to a tunneling proxy
const options = {
port: 1337,
host: '127.0.0.1',
@@ -387,7 +387,7 @@ proxy.listen(1337, '127.0.0.1', () => {
req.on('connect', (res, socket, head) => {
console.log('got connected!');
- // make a request over an HTTP tunnel
+ // Make a request over an HTTP tunnel
socket.write('GET / HTTP/1.1\r\n' +
'Host: www.google.com:80\r\n' +
'Connection: close\r\n' +
@@ -1313,7 +1313,7 @@ with any headers passed to [`response.writeHead()`][], with the headers passed
to [`response.writeHead()`][] given precedence.
```js
-// returns content-type = text/plain
+// Returns content-type = text/plain
const server = http.createServer((req, res) => {
res.setHeader('Content-Type', 'text/html');
res.setHeader('X-Foo', 'bar');
@@ -1506,7 +1506,7 @@ desired with potential future retrieval and modification, use
[`response.setHeader()`][] instead.
```js
-// returns content-type = text/plain
+// Returns content-type = text/plain
const server = http.createServer((req, res) => {
res.setHeader('Content-Type', 'text/html');
res.setHeader('X-Foo', 'bar');
@@ -1918,7 +1918,7 @@ http.get('http://nodejs.org/dist/index.json', (res) => {
}
if (error) {
console.error(error.message);
- // consume response data to free up memory
+ // Consume response data to free up memory
res.resume();
return;
}
diff --git a/doc/api/http2.md b/doc/api/http2.md
index ac4385ba11..434f603201 100644
--- a/doc/api/http2.md
+++ b/doc/api/http2.md
@@ -3138,7 +3138,7 @@ with any headers passed to [`response.writeHead()`][], with the headers passed
to [`response.writeHead()`][] given precedence.
```js
-// returns content-type = text/plain
+// Returns content-type = text/plain
const server = http2.createServer((req, res) => {
res.setHeader('Content-Type', 'text/html');
res.setHeader('X-Foo', 'bar');
@@ -3332,7 +3332,7 @@ with any headers passed to [`response.writeHead()`][], with the headers passed
to [`response.writeHead()`][] given precedence.
```js
-// returns content-type = text/plain
+// Returns content-type = text/plain
const server = http2.createServer((req, res) => {
res.setHeader('Content-Type', 'text/html');
res.setHeader('X-Foo', 'bar');
diff --git a/doc/api/inspector.md b/doc/api/inspector.md
index 0a11f6a1ff..f32f6c3032 100644
--- a/doc/api/inspector.md
+++ b/doc/api/inspector.md
@@ -171,7 +171,7 @@ session.post('Profiler.enable', () => {
// some time later...
session.post('Profiler.stop', (err, { profile }) => {
- // write profile to disk, upload, etc.
+ // Write profile to disk, upload, etc.
if (!err) {
fs.writeFileSync('./profile.cpuprofile', JSON.stringify(profile));
}
diff --git a/doc/api/modules.md b/doc/api/modules.md
index 222cf71f35..5ef61141a6 100644
--- a/doc/api/modules.md
+++ b/doc/api/modules.md
@@ -921,7 +921,7 @@ added: v10.12.0
const { createRequireFromPath } = require('module');
const requireUtil = createRequireFromPath('../src/utils');
-// require `../src/utils/some-tool`
+// Require `../src/utils/some-tool`
requireUtil('./some-tool');
```
diff --git a/doc/api/net.md b/doc/api/net.md
index 4cc741f7d4..eae4e74223 100644
--- a/doc/api/net.md
+++ b/doc/api/net.md
@@ -132,7 +132,7 @@ const server = net.createServer((socket) => {
throw err;
});
-// grab an arbitrary unused port.
+// Grab an arbitrary unused port.
server.listen(() => {
console.log('opened server on', server.address());
});
diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md
index 687cdae3aa..666734cf14 100644
--- a/doc/api/perf_hooks.md
+++ b/doc/api/perf_hooks.md
@@ -331,7 +331,7 @@ const {
} = require('perf_hooks');
const obs = new PerformanceObserver((list, observer) => {
- // Called three times synchronously. list contains one item
+ // Called three times synchronously. `list` contains one item.
});
obs.observe({ entryTypes: ['mark'] });
@@ -346,7 +346,7 @@ const {
} = require('perf_hooks');
const obs = new PerformanceObserver((list, observer) => {
- // called once. list contains three items
+ // Called once. `list` contains three items.
});
obs.observe({ entryTypes: ['mark'], buffered: true });
diff --git a/doc/api/process.md b/doc/api/process.md
index 45ed180bd5..38825d88e6 100644
--- a/doc/api/process.md
+++ b/doc/api/process.md
@@ -1286,7 +1286,7 @@ setTimeout(() => {
// [ 1, 552 ]
console.log(`Benchmark took ${diff[0] * NS_PER_SEC + diff[1]} nanoseconds`);
- // benchmark took 1000000552 nanoseconds
+ // Benchmark took 1000000552 nanoseconds
}, 1000);
```
diff --git a/doc/api/readline.md b/doc/api/readline.md
index 56a5254adc..4db4b0f899 100644
--- a/doc/api/readline.md
+++ b/doc/api/readline.md
@@ -457,7 +457,7 @@ For instance: `[[substr1, substr2, ...], originalsubstring]`.
function completer(line) {
const completions = '.help .error .exit .quit .q'.split(' ');
const hits = completions.filter((c) => c.startsWith(line));
- // show all completions if none found
+ // Show all completions if none found
return [hits.length ? hits : completions, line];
}
```
diff --git a/doc/api/stream.md b/doc/api/stream.md
index c9d4b035dd..bff9ee0683 100644
--- a/doc/api/stream.md
+++ b/doc/api/stream.md
@@ -256,8 +256,8 @@ function writeOneMillionTimes(writer, data, encoding, callback) {
// last time!
writer.write(data, encoding, callback);
} else {
- // see if we should continue, or wait
- // don't pass the callback, because we're not done yet.
+ // See if we should continue, or wait.
+ // Don't pass the callback, because we're not done yet.
ok = writer.write(data, encoding);
}
} while (i > 0 && ok);
@@ -418,7 +418,7 @@ const fs = require('fs');
const file = fs.createWriteStream('example.txt');
file.write('hello, ');
file.end('world!');
-// writing more now is not allowed!
+// Writing more now is not allowed!
```
##### writable.setDefaultEncoding(encoding)
@@ -819,7 +819,7 @@ cause some amount of data to be read into an internal buffer.
```javascript
const readable = getReadableStreamSomehow();
readable.on('readable', function() {
- // there is some data to read now
+ // There is some data to read now
let data;
while (data = this.read()) {
@@ -2431,7 +2431,7 @@ net.createServer((socket) => {
socket.end('The message was received but was not processed.\n');
});
- // start the flow of data, discarding it.
+ // Start the flow of data, discarding it.
socket.resume();
}).listen(1337);
```