Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1604848

Browse filesBrowse 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 <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 db61c95 commit 1604848
Copy full SHA for 1604848

File tree

Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Open diff view settings
Collapse file

‎doc/api/net.md‎

Copy file name to clipboardExpand all lines: doc/api/net.md
+6-6Lines changed: 6 additions & 6 deletions
  • Display the source diff
  • Display the rich diff
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.