Skip to content

Commit 7e98f23

Browse files
aqrlnMylesBorins
authored andcommitted
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. Backport-PR-URL: #11969 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]>
1 parent b2fc0f0 commit 7e98f23

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

doc/api/net.md

+6-6
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
@@ -874,8 +874,8 @@ server.listen(8124, () => {
874874

875875
Test this by using `telnet`:
876876

877-
```sh
878-
telnet localhost 8124
877+
```console
878+
$ telnet localhost 8124
879879
```
880880

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

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

892-
```js
893-
nc -U /tmp/echo.sock
892+
```console
893+
$ nc -U /tmp/echo.sock
894894
```
895895

896896
## net.isIP(input)

0 commit comments

Comments
 (0)