From 9892a5ddc3a96a784c409ee7f233919154246723 Mon Sep 17 00:00:00 2001 From: Joe Esposito Date: Tue, 26 Jul 2016 22:25:08 -0400 Subject: [PATCH] doc: remove extra spaces and concats in examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/7885 Reviewed-By: Brian White Reviewed-By: Anna Henningsen Reviewed-By: Сковорода Никита Андреевич Reviewed-By: Michaël Zasso Reviewed-By: James M Snell --- doc/api/addons.md | 2 +- doc/api/child_process.md | 2 +- doc/api/console.md | 2 +- doc/api/https.md | 8 ++++---- doc/api/modules.md | 2 +- doc/api/process.md | 4 ++-- doc/api/vm.md | 8 ++++---- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/api/addons.md b/doc/api/addons.md index a4041637f2..14b2b463ff 100644 --- a/doc/api/addons.md +++ b/doc/api/addons.md @@ -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' ``` diff --git a/doc/api/child_process.md b/doc/api/child_process.md index ffbacbe6ef..c0a395a044 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -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'] diff --git a/doc/api/console.md b/doc/api/console.md index f1835b2e19..84e3579074 100644 --- a/doc/api/console.md +++ b/doc/api/console.md @@ -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 ``` diff --git a/doc/api/https.md b/doc/api/https.md index e7cbc9969c..569bb1e3e6 100644 --- a/doc/api/https.md +++ b/doc/api/https.md @@ -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); @@ -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); diff --git a/doc/api/modules.md b/doc/api/modules.md index 836285b26f..04572a0f97 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -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`: diff --git a/doc/api/process.md b/doc/api/process.md index 856c48c70e..782ccc4c4c 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -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 }); ``` diff --git a/doc/api/vm.md b/doc/api/vm.md index e014994d75..8cc1f71ef1 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -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'