Skip to content

Commit b1d3f59

Browse files
aqrlnevanlucas
authored andcommittedMay 1, 2017
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: #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 75f4329 commit b1d3f59

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

895895
Test this by using `telnet`:
896896

897-
```sh
898-
telnet localhost 8124
897+
```console
898+
$ telnet localhost 8124
899899
```
900900

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

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

912-
```js
913-
nc -U /tmp/echo.sock
912+
```console
913+
$ nc -U /tmp/echo.sock
914914
```
915915

916916
## net.isIP(input)

0 commit comments

Comments
 (0)
Please sign in to comment.