diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/async_hooks.md | 2 | ||||
-rw-r--r-- | doc/api/cluster.md | 2 | ||||
-rw-r--r-- | doc/api/domain.md | 4 | ||||
-rw-r--r-- | doc/api/esm.md | 2 | ||||
-rw-r--r-- | doc/api/events.md | 2 | ||||
-rw-r--r-- | doc/api/path.md | 4 | ||||
-rw-r--r-- | doc/api/perf_hooks.md | 2 | ||||
-rw-r--r-- | doc/api/stream.md | 14 | ||||
-rw-r--r-- | doc/api/tracing.md | 2 | ||||
-rw-r--r-- | doc/api/vm.md | 2 | ||||
-rw-r--r-- | doc/api/zlib.md | 2 | ||||
-rw-r--r-- | doc/guides/writing-and-running-benchmarks.md | 2 |
12 files changed, 20 insertions, 20 deletions
diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index b0a0c7e23c..fe4f87c9ef 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -69,7 +69,7 @@ function before(asyncId) { } // After is called just after the resource's callback has finished. function after(asyncId) { } -// destroy is called when an AsyncWrap instance is destroyed. +// Destroy is called when an AsyncWrap instance is destroyed. function destroy(asyncId) { } // promiseResolve is called only for promise resources, when the diff --git a/doc/api/cluster.md b/doc/api/cluster.md index a84e301d0e..879f4af793 100644 --- a/doc/api/cluster.md +++ b/doc/api/cluster.md @@ -322,7 +322,7 @@ if (cluster.isMaster) { process.on('message', (msg) => { if (msg === 'shutdown') { - // initiate graceful close of any connections to server + // Initiate graceful close of any connections to server } }); } diff --git a/doc/api/domain.md b/doc/api/domain.md index 3a1027f07b..5ed1de4a4a 100644 --- a/doc/api/domain.md +++ b/doc/api/domain.md @@ -248,7 +248,7 @@ const serverDomain = domain.create(); serverDomain.run(() => { // server is created in the scope of serverDomain http.createServer((req, res) => { - // req and res are also created in the scope of serverDomain + // Req and res are also created in the scope of serverDomain // however, we'd prefer to have a separate domain for each request. // create it first thing, and add req and res to it. const reqd = domain.create(); @@ -316,7 +316,7 @@ const d = domain.create(); function readSomeFile(filename, cb) { fs.readFile(filename, 'utf8', d.bind((er, data) => { - // if this throws, it will also be passed to the domain + // If this throws, it will also be passed to the domain return cb(er, data ? JSON.parse(data) : null); })); } diff --git a/doc/api/esm.md b/doc/api/esm.md index 459f877718..bed1dd7b92 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -242,7 +242,7 @@ export async function dynamicInstantiate(url) { return { exports: ['customExportName'], execute: (exports) => { - // get and set functions provided for pre-allocated export names + // Get and set functions provided for pre-allocated export names exports.customExportName.set('value'); } }; diff --git a/doc/api/events.md b/doc/api/events.md index 4fcaeb3211..612b5aa04e 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -641,7 +641,7 @@ const logFnWrapper = listeners[0]; // Logs "log once" to the console and does not unbind the `once` event logFnWrapper.listener(); -// logs "log once" to the console and removes the listener +// Logs "log once" to the console and removes the listener logFnWrapper(); emitter.on('log', () => console.log('log persistently')); diff --git a/doc/api/path.md b/doc/api/path.md index 4cfa4fa8ae..0248d5dbb5 100644 --- a/doc/api/path.md +++ b/doc/api/path.md @@ -299,7 +299,7 @@ path.join('/foo', 'bar', 'baz/asdf', 'quux', '..'); // Returns: '/foo/bar/baz/asdf' path.join('foo', {}, 'bar'); -// throws 'TypeError: Path must be a string. Received {}' +// Throws 'TypeError: Path must be a string. Received {}' ``` A [`TypeError`][] is thrown if any of the path segments is not a string. @@ -495,7 +495,7 @@ path.resolve('/foo/bar', '/tmp/file/'); // Returns: '/tmp/file' path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif'); -// if the current working directory is /home/myself/node, +// If the current working directory is /home/myself/node, // this returns '/home/myself/node/wwwroot/static_files/gif/image.gif' ``` diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md index f16a217bbe..a891e875b5 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'] }); 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'); diff --git a/doc/api/tracing.md b/doc/api/tracing.md index 502998c7b6..e09455d643 100644 --- a/doc/api/tracing.md +++ b/doc/api/tracing.md @@ -133,7 +133,7 @@ t2.enable(); // Prints 'node,node.perf,v8' console.log(trace_events.getEnabledCategories()); -t2.disable(); // will only disable emission of the 'node.perf' category +t2.disable(); // Will only disable emission of the 'node.perf' category // Prints 'node,v8' console.log(trace_events.getEnabledCategories()); diff --git a/doc/api/vm.md b/doc/api/vm.md index f5b43df61a..4c1c7d7cf5 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -33,7 +33,7 @@ const sandbox = { x: 2 }; vm.createContext(sandbox); // Contextify the sandbox. const code = 'x += 40; var y = 17;'; -// x and y are global variables in the sandboxed environment. +// `x` and `y` are global variables in the sandboxed environment. // Initially, x has the value 2 because that is the value of sandbox.x. vm.runInContext(code, sandbox); diff --git a/doc/api/zlib.md b/doc/api/zlib.md index b9d506c9e4..7b8f9187ef 100644 --- a/doc/api/zlib.md +++ b/doc/api/zlib.md @@ -81,7 +81,7 @@ request.on('response', (response) => { const output = fs.createWriteStream('example.com_index.html'); switch (response.headers['content-encoding']) { - // or, just use zlib.createUnzip() to handle both cases + // Or, just use zlib.createUnzip() to handle both cases case 'gzip': response.pipe(zlib.createGunzip()).pipe(output); break; diff --git a/doc/guides/writing-and-running-benchmarks.md b/doc/guides/writing-and-running-benchmarks.md index 693107f4c2..f0d6d289fa 100644 --- a/doc/guides/writing-and-running-benchmarks.md +++ b/doc/guides/writing-and-running-benchmarks.md @@ -397,7 +397,7 @@ const options = { flags: ['--zero-fill-buffers'] }; -// main and configs are required, options is optional. +// `main` and `configs` are required, `options` is optional. const bench = common.createBenchmark(main, configs, options); // Note that any code outside main will be run twice, |