Skip to content

Commit

Permalink
doc: simplify and correct example descriptions in net.md
Browse files Browse the repository at this point in the history
Instead of indicating that examples show lines to change in previous
examples, present the examples as standalone items. They suffice on
their own.

In the first of these, it says to change "the second line" of a previous
example, but if it were literally changed to the provided line, it would
result in a syntax error.

In the second of these, it gives the wrong line to change.

All of this is unnecessary and probably makes the examples harder to
follow. So simplify and treat each one as a separate example.

PR-URL: #32451
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott committed Mar 26, 2020
1 parent dade90d commit f0a33d9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions doc/api/net.md
Original file line number Diff line number Diff line change
Expand Up @@ -1064,8 +1064,7 @@ client.on('end', () => {
});
```

To connect on the socket `/tmp/echo.sock` the second line would just be
changed to:
To connect on the socket `/tmp/echo.sock`:

```js
const client = net.createConnection({ path: '/tmp/echo.sock' });
Expand Down Expand Up @@ -1174,8 +1173,7 @@ Test this by using `telnet`:
$ telnet localhost 8124
```

To listen on the socket `/tmp/echo.sock` the third line from the last would
just be changed to:
To listen on the socket `/tmp/echo.sock`:

```js
server.listen('/tmp/echo.sock', () => {
Expand Down

0 comments on commit f0a33d9

Please sign in to comment.