why-is-node-running alternatives and similar modules
Based on the "Debugging / Profiling" category.
Alternatively, view why-is-node-running alternatives based on common mentions on social networks and blogs.
-
debug
A tiny JavaScript debugging utility modelled after Node.js core's debugging technique. Works in Node.js and web browsers -
llnode
An lldb plugin for Node.js and V8, which enables inspection of JavaScript states for insights into Node.js processes and their core dumps. -
swagger-stats
API Observability. Trace API calls and Monitor API performance, health and usage statistics in Node.js Microservices. -
thetool
thetool is a CLI tool to capture different cpu, memory and other profiles for your node app in Chrome DevTools friendly format
CodeRabbit: AI Code Reviews for Developers
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of why-is-node-running or a related project?
README
why-is-node-running
Node is running but you don't know why? why-is-node-running
is here to help you.
Installation
Node 8 and above:
npm i why-is-node-running -g
Earlier Node versions (no longer supported):
npm i [email protected] -g
Usage
const log = require('why-is-node-running') // should be your first require
const net = require('net')
function createServer () {
const server = net.createServer()
setInterval(function () {}, 1000)
server.listen(0)
}
createServer()
createServer()
setTimeout(function () {
log() // logs out active handles that are keeping node running
}, 100)
Save the file as example.js
, then execute:
node ./example.js
Here's the output:
There are 5 handle(s) keeping the process running
# Timeout
/home/maf/dev/node_modules/why-is-node-running/example.js:6 - setInterval(function () {}, 1000)
/home/maf/dev/node_modules/why-is-node-running/example.js:10 - createServer()
# TCPSERVERWRAP
/home/maf/dev/node_modules/why-is-node-running/example.js:7 - server.listen(0)
/home/maf/dev/node_modules/why-is-node-running/example.js:10 - createServer()
# Timeout
/home/maf/dev/node_modules/why-is-node-running/example.js:6 - setInterval(function () {}, 1000)
/home/maf/dev/node_modules/why-is-node-running/example.js:11 - createServer()
# TCPSERVERWRAP
/home/maf/dev/node_modules/why-is-node-running/example.js:7 - server.listen(0)
/home/maf/dev/node_modules/why-is-node-running/example.js:11 - createServer()
# Timeout
/home/maf/dev/node_modules/why-is-node-running/example.js:13 - setTimeout(function () {
Important Note!
unref
ed timers do not prevent the Node process from exiting. If you are running with Node v11.0.0 and above, unref
ed timers will not be listed in the above list. Unfortunately, this is not supported in node versions below v11.0.0.
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
/SIGINFO
signal to the process will produce the log. (Ctrl + T
on macOS and BSD systems)
why-is-node-running /path/to/some/file.js
probing module /path/to/some/file.js
kill -SIGUSR1 31115 for logging
To trigger the log:
kill -SIGUSR1 31115
Require CLI Option
You can also use the node -r
option to include why-is-node-running
:
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
*Note that all licence references and agreements mentioned in the why-is-node-running README section above
are relevant to that project's source code only.