Determine in realtime what's happening inside your node process from the terminal. No need to instrument code to get the deets. Also splits stderr/stdout to help spot errors sooner.
npm install nodejs-dashboard --save-dev
From within your index.js
or app entry point simply require the nodejs-dashboard
module.
require("nodejs-dashboard");
It's recommended that you create a npm script to launch the dashboard.
...
"scripts": {
"dev": "nodejs-dashboard node index.js"
}
...
Once you've completed these steps run the following in your terminal:
% npm run dev
Usage: nodejs-dashboard [options] -- [node] [script] [arguments]
Options:
-h, --help output usage information
-V, --version output the version number
-p, --port [port] Socket listener port
-e, --eventdelay [ms] Minimum threshold for event loop reporting, default 10ms
#####-port
Under the hood the dashboard utilizes SocketIO with a default port of 9838
. If this conflicts with an existing service you can optionally change this value.
#####-eventdelay
This tunes the minimum threshold for reporting event loop delays. The default value is 10ms
. Any delay below this value will be reported at 0
.