Skip to content

Commit e9d6efa

Browse files
committed
doc: fix stylistic issues in api/net.md
* 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: nodejs#11786 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 60ad7af commit e9d6efa

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

doc/api/net.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Returns an object with `port`, `family`, and `address` properties:
6666
Example:
6767

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

212212
```js
213213
net.createServer().listen(
214-
path.join('\\\\?\\pipe', process.cwd(), 'myctl'))
214+
path.join('\\\\?\\pipe', process.cwd(), 'myctl'));
215215
```
216216

217217
The parameter `backlog` behaves the same as in
@@ -893,8 +893,8 @@ server.listen(8124, () => {
893893

894894
Test this by using `telnet`:
895895

896-
```sh
897-
telnet localhost 8124
896+
```console
897+
$ telnet localhost 8124
898898
```
899899

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

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

911-
```js
912-
nc -U /tmp/echo.sock
911+
```console
912+
$ nc -U /tmp/echo.sock
913913
```
914914

915915
## net.isIP(input)

0 commit comments

Comments
 (0)