Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use siginfo for easy Ctrl + T access on mac #55

Merged
merged 2 commits into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ There are 5 handle(s) keeping the process running

## CLI

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.
You can also run `why-is-node-running` as a standalone if you don't want to include it inside your code. Sending `SIGUSR1`/`SIGINFO` signal to the process will produce the log. (`Ctrl + T` on macOS and BSD systems)

```bash
why-is-node-running /path/to/some/file.js
Expand All @@ -89,6 +89,16 @@ To trigger the log:
kill -SIGUSR1 31115
```

## Require CLI Option

You can also use the node `-r` option to include `why-is-node-running`:

```bash
node -r why-is-node-running/include /path/to/some/file.js
```

The steps are otherwise the same as the above CLI section

## License

MIT
2 changes: 1 addition & 1 deletion include.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
var why = require('./')

process.on('SIGUSR1', function() { why() })
require('siginfo')(why)
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Node is running but you don't know why? why-is-node-running is here to help you.",
"main": "index.js",
"dependencies": {
"siginfo": "^2.0.0",
"stackback": "0.0.2"
},
"bin": {
Expand Down