Skip to content

Commit 9892a5d

Browse files
joeyespoMylesBorins
authored andcommitted
doc: remove extra spaces and concats in examples
PR-URL: #7885 Reviewed-By: Brian White <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent d40873d commit 9892a5d

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

doc/api/addons.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ const addon = require('./build/Release/addon');
423423
424424
var obj1 = addon('hello');
425425
var obj2 = addon('world');
426-
console.log(obj1.msg + ' ' + obj2.msg); // 'hello world'
426+
console.log(obj1.msg, obj2.msg); // 'hello world'
427427
```
428428

429429

doc/api/child_process.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ const spawn = require('child_process').spawn;
814814

815815
let child = spawn('sh', ['-c',
816816
`node -e "setInterval(() => {
817-
console.log(process.pid + 'is alive')
817+
console.log(process.pid, 'is alive')
818818
}, 500);"`
819819
], {
820820
stdio: ['inherit', 'inherit', 'inherit']

doc/api/console.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ values similar to `printf(3)` (the arguments are all passed to
220220
var count = 5;
221221
console.log('count: %d', count);
222222
// Prints: count: 5, to stdout
223-
console.log('count: ', count);
223+
console.log('count:', count);
224224
// Prints: count: 5, to stdout
225225
```
226226

doc/api/https.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ Example:
107107
const https = require('https');
108108

109109
https.get('https://encrypted.google.com/', (res) => {
110-
console.log('statusCode: ', res.statusCode);
111-
console.log('headers: ', res.headers);
110+
console.log('statusCode:', res.statusCode);
111+
console.log('headers:', res.headers);
112112

113113
res.on('data', (d) => {
114114
process.stdout.write(d);
@@ -151,8 +151,8 @@ var options = {
151151
};
152152

153153
var req = https.request(options, (res) => {
154-
console.log('statusCode: ', res.statusCode);
155-
console.log('headers: ', res.headers);
154+
console.log('statusCode:', res.statusCode);
155+
console.log('headers:', res.headers);
156156

157157
res.on('data', (d) => {
158158
process.stdout.write(d);

doc/api/modules.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The contents of `foo.js`:
1212

1313
```js
1414
const circle = require('./circle.js');
15-
console.log( `The area of a circle of radius 4 is ${circle.area(4)}`);
15+
console.log(`The area of a circle of radius 4 is ${circle.area(4)}`);
1616
```
1717

1818
The contents of `circle.js`:

doc/api/process.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ Here is an example that logs every unhandled rejection to the console
171171

172172
```js
173173
process.on('unhandledRejection', (reason, p) => {
174-
console.log("Unhandled Rejection at: Promise ", p, " reason: ", reason);
175-
// application specific logging, throwing an error, or other logic here
174+
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
175+
// application specific logging, throwing an error, or other logic here
176176
});
177177
```
178178

doc/api/vm.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,12 @@ const vm = require('vm');
296296
var localVar = 'initial value';
297297

298298
const vmResult = vm.runInThisContext('localVar = "vm";');
299-
console.log('vmResult: ', vmResult);
300-
console.log('localVar: ', localVar);
299+
console.log('vmResult:', vmResult);
300+
console.log('localVar:', localVar);
301301

302302
const evalResult = eval('localVar = "eval";');
303-
console.log('evalResult: ', evalResult);
304-
console.log('localVar: ', localVar);
303+
console.log('evalResult:', evalResult);
304+
console.log('localVar:', localVar);
305305

306306
// vmResult: 'vm', localVar: 'initial value'
307307
// evalResult: 'eval', localVar: 'eval'

0 commit comments

Comments
 (0)