You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-13Lines changed: 28 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,29 @@
1
1
# why-is-node-running
2
2
3
-
Node is running but you don't know why? why-is-node-running is here to help you.
3
+
Node is running but you don't know why? `why-is-node-running` is here to help you.
4
4
5
+
## Installation
6
+
7
+
Node 8 and above:
8
+
9
+
```bash
10
+
npm i why-is-node-running -g
5
11
```
6
-
$ npm install why-is-node-running
12
+
13
+
Earlier Node versions (no longer supported):
14
+
15
+
```bash
16
+
npm i why-is-node-running@v1.x -g
7
17
```
8
18
9
19
## Usage
10
20
11
-
```js
12
-
var log =require('why-is-node-running') // should be your first require
13
-
var net =require('net')
21
+
```js
22
+
constlog=require('why-is-node-running') // should be your first require
23
+
constnet=require('net')
14
24
15
25
functioncreateServer () {
16
-
var server =net.createServer()
26
+
constserver=net.createServer()
17
27
setInterval(function () {}, 1000)
18
28
server.listen(0)
19
29
}
@@ -26,7 +36,13 @@ setTimeout(function () {
26
36
}, 100)
27
37
```
28
38
29
-
Run the above script like this: `node example.js`. It will print the following:
39
+
Save the file as `example.js`, then execute:
40
+
41
+
```bash
42
+
node ./example.js
43
+
```
44
+
45
+
Here's the output:
30
46
31
47
```
32
48
There are 5 handle(s) keeping the process running
@@ -53,22 +69,21 @@ There are 5 handle(s) keeping the process running
53
69
54
70
## CLI
55
71
56
-
You can also run `why-is-node-running` standalone if you don't want to include it inside your code. Sending `SIGUSR1` signal to the process will produce the log.
72
+
You can also run `why-is-node-running`as a standalone if you don't want to include it inside your code. Sending `SIGUSR1` signal to the process will produce the log.
0 commit comments