{
  "source": "doc/api/synopsis.md",
  "introduced_in": "v0.10.0",
  "miscs": [
    {
      "textRaw": "Usage",
      "name": "Usage",
      "introduced_in": "v0.10.0",
      "type": "misc",
      "desc": "<p><code>node [options] [V8 options] [script.js | -e &quot;script&quot; | - ] [arguments]</code></p>\n<p>Please see the <a href=\"cli.html#cli_command_line_options\">Command Line Options</a> document for information about\ndifferent options and ways to run scripts with Node.js.</p>\n<h2>Example</h2>\n<p>An example of a <a href=\"http.html\">web server</a> written with Node.js which responds with\n<code>&#39;Hello World&#39;</code>:</p>\n<pre><code class=\"lang-js\">const http = require(&#39;http&#39;);\n\nconst hostname = &#39;127.0.0.1&#39;;\nconst port = 3000;\n\nconst server = http.createServer((req, res) =&gt; {\n  res.statusCode = 200;\n  res.setHeader(&#39;Content-Type&#39;, &#39;text/plain&#39;);\n  res.end(&#39;Hello World\\n&#39;);\n});\n\nserver.listen(port, hostname, () =&gt; {\n  console.log(`Server running at http://${hostname}:${port}/`);\n});\n</code></pre>\n<p>To run the server, put the code into a file called <code>example.js</code> and execute\nit with Node.js:</p>\n<pre><code class=\"lang-txt\">$ node example.js\nServer running at http://127.0.0.1:3000/\n</code></pre>\n<p>All of the examples in the documentation can be run similarly.</p>\n"
    }
  ]
}
