diff --git a/doc/api/index.md b/doc/api/index.md index 24c38d0f3a70..146c0e13df65 100644 --- a/doc/api/index.md +++ b/doc/api/index.md @@ -3,7 +3,6 @@ * [About this documentation](documentation.md) -* [Usage and example](synopsis.md)
diff --git a/doc/api/synopsis.md b/doc/api/synopsis.md deleted file mode 100644 index 85b2b4cf7470..000000000000 --- a/doc/api/synopsis.md +++ /dev/null @@ -1,87 +0,0 @@ -# Usage and example - - - - - -## Usage - -`node [options] [V8 options] [script.js | -e "script" | - ] [arguments]` - -Please see the [Command-line options][] document for more information. - -## Example - -An example of a [web server][] written with Node.js which responds with -`'Hello, World!'`: - -First, make sure to have downloaded and installed Node.js. See -[Installing Node.js][] for further install information. - -Now, create an empty project folder called `projects`, then navigate into it. - -Linux and Mac: - -```bash -mkdir ~/projects -cd ~/projects -``` - -Windows CMD: - -```powershell -mkdir %USERPROFILE%\projects -cd %USERPROFILE%\projects -``` - -Windows PowerShell: - -```powershell -mkdir $env:USERPROFILE\projects -cd $env:USERPROFILE\projects -``` - -Next, create a new source file in the `projects` -folder and call it `hello-world.js`. - -Open `hello-world.js` in any preferred text editor and -paste in the following content: - -```js -const http = require('node:http'); - -const hostname = '127.0.0.1'; -const port = 3000; - -const server = http.createServer((req, res) => { - res.statusCode = 200; - res.setHeader('Content-Type', 'text/plain'); - res.end('Hello, World!\n'); -}); - -server.listen(port, hostname, () => { - console.log(`Server running at http://${hostname}:${port}/`); -}); -``` - -Save the file. Then, in the terminal window, to run the `hello-world.js` file, -enter: - -```bash -node hello-world.js -``` - -Output like this should appear in the terminal: - -```console -Server running at http://127.0.0.1:3000/ -``` - -Now, open any preferred web browser and visit `http://127.0.0.1:3000`. - -If the browser displays the string `Hello, World!`, that indicates -the server is working. - -[Command-line options]: cli.md#options -[Installing Node.js]: https://nodejs.org/en/download -[web server]: http.md diff --git a/test/doctool/test-doc-api-json.mjs b/test/doctool/test-doc-api-json.mjs index 66302d3605c2..2f085ad9b439 100644 --- a/test/doctool/test-doc-api-json.mjs +++ b/test/doctool/test-doc-api-json.mjs @@ -153,7 +153,6 @@ for await (const dirent of await fs.opendir(new URL('../../out/doc/api/', import 'packages.md': ['introduced_in', 'meta', 'miscs'], 'process.md': ['globals'], 'report.md': ['introduced_in', 'meta', 'stability', 'stabilityText', 'miscs'], - 'synopsis.md': ['introduced_in', 'miscs'], }[dirent.name] ?? ['modules'])]); assert.partialDeepStrictEqual(allExpectedKeys, findAllKeys(json));