diff options
author | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2017-05-31 16:50:50 +0300 |
---|---|---|
committer | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2017-06-02 16:47:47 +0300 |
commit | a235e670a820107210be27e0cd266164763fb014 (patch) | |
tree | 41ae1cea132d2c6c5e9bd38ffceddd72c261cb65 /doc/api/vm.md | |
parent | 41919626e5e3dcc04101a2c21f689fbfad24686f (diff) | |
download | android-node-v8-a235e670a820107210be27e0cd266164763fb014.tar.gz android-node-v8-a235e670a820107210be27e0cd266164763fb014.tar.bz2 android-node-v8-a235e670a820107210be27e0cd266164763fb014.zip |
doc: refine spaces in example from vm.md
PR-URL: https://github.com/nodejs/node/pull/13334
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'doc/api/vm.md')
-rw-r--r-- | doc/api/vm.md | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/doc/api/vm.md b/doc/api/vm.md index aa36319ac2..288dcaf9e3 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -442,18 +442,17 @@ to the `http` module passed to it. For instance: 'use strict'; const vm = require('vm'); -const code = -`(function(require) { +const code = ` +(function(require) { + const http = require('http'); - const http = require('http'); + http.createServer((request, response) => { + response.writeHead(200, { 'Content-Type': 'text/plain' }); + response.end('Hello World\\n'); + }).listen(8124); - http.createServer( (request, response) => { - response.writeHead(200, {'Content-Type': 'text/plain'}); - response.end('Hello World\\n'); - }).listen(8124); - - console.log('Server running at http://127.0.0.1:8124/'); - })`; + console.log('Server running at http://127.0.0.1:8124/'); +})`; vm.runInThisContext(code)(require); ``` |