Skip to content

Commit 8f7908d

Browse files
fluxsaucemafintosh
authored andcommitted
Documentation and configuration cleanup. (#33)
* Documentation and configuration cleanup. * Updating with global instructions. * Code review feedback.
1 parent fe400e6 commit 8f7908d

3 files changed

Lines changed: 98 additions & 14 deletions

File tree

.gitignore

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,61 @@
1-
node_modules
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# Bower dependency directory (https://bower.io/)
27+
bower_components
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (https://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# Typescript v1 declaration files
40+
typings/
41+
42+
# Optional npm cache directory
43+
.npm
44+
45+
# Optional eslint cache
46+
.eslintcache
47+
48+
# Optional REPL history
49+
.node_repl_history
50+
51+
# Output of 'npm pack'
52+
*.tgz
53+
54+
# Yarn Integrity file
55+
.yarn-integrity
56+
57+
# dotenv environment variables file
58+
.env
59+
60+
# next.js build output
61+
.next

README.md

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
# why-is-node-running
22

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.
44

5+
## Installation
6+
7+
Node 8 and above:
8+
9+
```bash
10+
npm i why-is-node-running -g
511
```
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
717
```
818

919
## Usage
1020

11-
``` js
12-
var log = require('why-is-node-running') // should be your first require
13-
var net = require('net')
21+
```js
22+
const log = require('why-is-node-running') // should be your first require
23+
const net = require('net')
1424

1525
function createServer () {
16-
var server = net.createServer()
26+
const server = net.createServer()
1727
setInterval(function () {}, 1000)
1828
server.listen(0)
1929
}
@@ -26,7 +36,13 @@ setTimeout(function () {
2636
}, 100)
2737
```
2838

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:
3046

3147
```
3248
There are 5 handle(s) keeping the process running
@@ -53,22 +69,21 @@ There are 5 handle(s) keeping the process running
5369

5470
## CLI
5571

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.
5773

58-
```
59-
$ npm install why-is-node-running -g
74+
```bash
75+
why-is-node-running /path/to/some/file.js
6076
```
6177

6278
```
63-
$ why-is-node-running /path/to/some/file.js
6479
probing module /path/to/some/file.js
6580
kill -SIGUSR1 31115 for logging
6681
```
6782

68-
To trigger the log do:
83+
To trigger the log:
6984

7085
```
71-
$ kill -SIGUSR1 31115
86+
kill -SIGUSR1 31115
7287
```
7388

7489
## License

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
"bin": {
1010
"why-is-node-running": "cli.js"
1111
},
12+
"engines": {
13+
"node": ">=8"
14+
},
1215
"repository": {
1316
"type": "git",
1417
"url": "https://github.com/mafintosh/why-is-node-running.git"
@@ -21,6 +24,12 @@
2124
"handles"
2225
],
2326
"author": "Mathias Buus (@mafintosh)",
27+
"contributors": [
28+
{
29+
"name": "Jon Peck",
30+
"email": "jpeck@fluxsauce.com"
31+
}
32+
],
2433
"license": "MIT",
2534
"bugs": {
2635
"url": "https://github.com/mafintosh/why-is-node-running/issues"

0 commit comments

Comments
 (0)