Skip to content

Commit

Permalink
doc: remove extra spaces and concats in examples
Browse files Browse the repository at this point in the history
PR-URL: #7885
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
joeyespo authored and MylesBorins committed Oct 26, 2016
1 parent d40873d commit 9892a5d
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion doc/api/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ const addon = require('./build/Release/addon');
var obj1 = addon('hello');
var obj2 = addon('world');
console.log(obj1.msg + ' ' + obj2.msg); // 'hello world'
console.log(obj1.msg, obj2.msg); // 'hello world'
```


Expand Down
2 changes: 1 addition & 1 deletion doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ const spawn = require('child_process').spawn;

let child = spawn('sh', ['-c',
`node -e "setInterval(() => {
console.log(process.pid + 'is alive')
console.log(process.pid, 'is alive')
}, 500);"`
], {
stdio: ['inherit', 'inherit', 'inherit']
Expand Down
2 changes: 1 addition & 1 deletion doc/api/console.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ values similar to `printf(3)` (the arguments are all passed to
var count = 5;
console.log('count: %d', count);
// Prints: count: 5, to stdout
console.log('count: ', count);
console.log('count:', count);
// Prints: count: 5, to stdout
```

Expand Down
8 changes: 4 additions & 4 deletions doc/api/https.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ Example:
const https = require('https');

https.get('https://encrypted.google.com/', (res) => {
console.log('statusCode: ', res.statusCode);
console.log('headers: ', res.headers);
console.log('statusCode:', res.statusCode);
console.log('headers:', res.headers);

res.on('data', (d) => {
process.stdout.write(d);
Expand Down Expand Up @@ -151,8 +151,8 @@ var options = {
};

var req = https.request(options, (res) => {
console.log('statusCode: ', res.statusCode);
console.log('headers: ', res.headers);
console.log('statusCode:', res.statusCode);
console.log('headers:', res.headers);

res.on('data', (d) => {
process.stdout.write(d);
Expand Down
2 changes: 1 addition & 1 deletion doc/api/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The contents of `foo.js`:

```js
const circle = require('./circle.js');
console.log( `The area of a circle of radius 4 is ${circle.area(4)}`);
console.log(`The area of a circle of radius 4 is ${circle.area(4)}`);
```

The contents of `circle.js`:
Expand Down
4 changes: 2 additions & 2 deletions doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ Here is an example that logs every unhandled rejection to the console

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

Expand Down
8 changes: 4 additions & 4 deletions doc/api/vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,12 @@ const vm = require('vm');
var localVar = 'initial value';

const vmResult = vm.runInThisContext('localVar = "vm";');
console.log('vmResult: ', vmResult);
console.log('localVar: ', localVar);
console.log('vmResult:', vmResult);
console.log('localVar:', localVar);

const evalResult = eval('localVar = "eval";');
console.log('evalResult: ', evalResult);
console.log('localVar: ', localVar);
console.log('evalResult:', evalResult);
console.log('localVar:', localVar);

// vmResult: 'vm', localVar: 'initial value'
// evalResult: 'eval', localVar: 'eval'
Expand Down

0 comments on commit 9892a5d

Please sign in to comment.