Skip to content

Commit

Permalink
doc: fix stylistic issues in api/net.md
Browse files Browse the repository at this point in the history
* Change var to const in an example of server creation.
* Add missing semicolons.
* Use `console` syntax highlighting in `telnet` and `nc` invocation
  examples and add shell prompt symbols to be consistent with the rest
  of the documentation.

PR-URL: #11786
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
aqrln authored and evanlucas committed May 1, 2017
1 parent 75f4329 commit b1d3f59
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions doc/api/net.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Returns an object with `port`, `family`, and `address` properties:
Example:

```js
var server = net.createServer((socket) => {
const server = net.createServer((socket) => {
socket.end('goodbye\n');
}).on('error', (err) => {
// handle errors here
Expand Down Expand Up @@ -211,7 +211,7 @@ double-backslashes, such as:

```js
net.createServer().listen(
path.join('\\\\?\\pipe', process.cwd(), 'myctl'))
path.join('\\\\?\\pipe', process.cwd(), 'myctl'));
```

The parameter `backlog` behaves the same as in
Expand Down Expand Up @@ -894,8 +894,8 @@ server.listen(8124, () => {

Test this by using `telnet`:

```sh
telnet localhost 8124
```console
$ telnet localhost 8124
```

To listen on the socket `/tmp/echo.sock` the third line from the last would
Expand All @@ -909,8 +909,8 @@ server.listen('/tmp/echo.sock', () => {

Use `nc` to connect to a UNIX domain socket server:

```js
nc -U /tmp/echo.sock
```console
$ nc -U /tmp/echo.sock
```

## net.isIP(input)
Expand Down

0 comments on commit b1d3f59

Please sign in to comment.