Skip to content

Commit 47cf571

Browse files
committed
corrections
1 parent bf4e20f commit 47cf571

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

doc/api/synopsis.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ An example of a [web server][] written with Node.js which responds with
1414

1515
Commands displayed in this document are shown starting with `$` or `>`
1616
to replicate how they would appear in a user's terminal.
17-
Do not include the `$` and `>` character.
18-
They are there to indicate the start of each command.
17+
Do not include the `$` and `>` character they are there to
18+
indicate the start of each command.
1919

2020
There are many tutorials and examples that follow this
2121
convention: `$` or `>` for commands run as a regular user, and `#`
@@ -24,22 +24,22 @@ for commands that should be executed as an administrator.
2424
Lines that don’t start with `$` or `>` character are typically showing
2525
the output of the previous command.
2626

27-
Firstly, make sure to have downloaded Node.js from [Node.js Official website](http://nodejs.org/#download).
28-
29-
To install Node using a package manager, see [this guide](https://nodejs.org/en/download/package-manager/).
30-
27+
Firstly, make sure to have downloaded and installed Node.js.
28+
See [this guide][] for further install information.
3129

3230
Now, create an empty project folder called `projects`, navigate into it:
3331
Project folder can be named base on user's current project title but
3432
this example will use `projects` as the project folder.
3533

36-
UNIX :
34+
Linux and Mac:
3735

3836
```console
3937
$ mkdir ~/projects
4038
$ cd ~/projects
4139
```
40+
4241
Windows CMD:
42+
4343
```console
4444
> mkdir %USERPROFILE%\projects
4545
> cd %USERPROFILE%\projects
@@ -55,17 +55,12 @@ Windows PowerShell:
5555
Next, create a new source file in the `projects` folder
5656
and call it `hello-world.js`.
5757

58-
If filename has more than one word, use a hyphen(`-`) or
59-
an underscore(`_`) to separate them for simplicity and avoid using
60-
the space character in file names.
61-
62-
For example, use `hello-world.js` rather than `hello world.js`.
63-
Node.js files always end with the `.js` extension.
58+
In Node.js it is considered good style to use hyphens (`-`) or underscores (`_`) to separate
59+
multiple words in filenames.
6460

6561
Open `hello-world.js` in any preferred text editor and paste in the following
6662
content.
6763

68-
6964
```js
7065
const http = require('http');
7166

@@ -82,16 +77,20 @@ server.listen(port, hostname, () => {
8277
console.log(`Server running at http://${hostname}:${port}/`);
8378
});
8479
```
80+
8581
Save the file, go back to the terminal window enter the following command:
8682

8783
```console
8884
$ node hello-world.js
8985
```
90-
an output like this should appear in the terminal to indicate Node.js
86+
87+
An output like this should appear in the terminal to indicate Node.js
9188
server is running:
89+
9290
```console
9391
Server running at http://127.0.0.1:3000/
9492
````
93+
9594
Now, open any preferred web browser and visit `http://127.0.0.1:3000`.
9695
9796
If the browser displays the string `Hello, world!`, that indicates
@@ -101,3 +100,5 @@ Many of the examples in the documentation can be run similarly.
101100

102101
[Command Line Options]: cli.html#cli_command_line_options
103102
[web server]: http.html
103+
[this guide]: https://nodejs.org/en/download/package-manager/
104+
[Node.js Official website]: http://nodejs.org/#download

0 commit comments

Comments
 (0)