Skip to content

Commit 3c55d1a

Browse files
vsemozhetbytjasnell
authored andcommitted
doc: refine spaces in example from vm.md
PR-URL: #13334 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 1bcda5e commit 3c55d1a

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

doc/api/vm.md

+9-10
Original file line numberDiff line numberDiff line change
@@ -442,18 +442,17 @@ to the `http` module passed to it. For instance:
442442
'use strict';
443443
const vm = require('vm');
444444

445-
const code =
446-
`(function(require) {
445+
const code = `
446+
(function(require) {
447+
const http = require('http');
447448
448-
const http = require('http');
449+
http.createServer((request, response) => {
450+
response.writeHead(200, { 'Content-Type': 'text/plain' });
451+
response.end('Hello World\\n');
452+
}).listen(8124);
449453
450-
http.createServer( (request, response) => {
451-
response.writeHead(200, {'Content-Type': 'text/plain'});
452-
response.end('Hello World\\n');
453-
}).listen(8124);
454-
455-
console.log('Server running at http://127.0.0.1:8124/');
456-
})`;
454+
console.log('Server running at http://127.0.0.1:8124/');
455+
})`;
457456

458457
vm.runInThisContext(code)(require);
459458
```

0 commit comments

Comments
 (0)