| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Node Inspector is a debugger interface for node.js using the Blink Developer Tools (former WebKit Web Inspector).
The Blink DevTools debugger is a great javascript debugger interface; it works just as well for node. Node Inspector supports almost all of the debugging features of DevTools.
This is beta-quality code, so use at your own risk.
With npm
$ npm install -g node-inspector
To use node-inspector, enable debugging on the node you wish to debug. You can either start node with a debug flag like:
$ node --debug your/node/program.js
or, to pause your script on the first line:
$ node --debug-brk your/short/node/script.js
Or you can enable debugging on a node that is already running by sending it a signal:
Get the PID of the node process using your favorite method. pgrep or ps -ef are good
$ pgrep -l node 2345 node your/node/server.js
Send it the USR1 signal
$ kill -s USR1 2345
Great! Now you are ready to attach node-inspector
start the inspector. I usually put it in the background
$ node-inspector &
open http://127.0.0.1:8080/debug?port=5858 in Chrome
you should now see the javascript source from node. If you don't, click the scripts tab.
select a script and set some breakpoints (far left line numbers)
then watch the screencasts
For more information on getting started see the wiki
node-inspector works almost exactly like the web inspector in Chrome. Here's a good overview of the UI
Node-inspector uses rc [github] module to collect options.
Places for configuration:
All configuration sources that where found will be flattened into one object, so that sources earlier in this list override later ones.
List of predefined options:
Option Default Description
--help | | Print information about options
--web-port | 8080 | Port to host the inspector
--web-host | 127.0.0.1 | Host to listen on
--debug-port | 5858 | Port to connect to the debugging app
--save-live-edit | false | Save live edit changes to disk (update the edited files)
--hidden | [] | Array of files to hide from the UI
| | Breakpoints in these files will be ignored
use --debug-brk to pause the script on the first line
when in doubt, refresh
Yes. node-inspector must be running on the same machine, but your browser can be anywhere. Just make sure port 8080 is accessible
Create a JSON-encoded array, don't forget to escape the quote characters when using a command-line option.
$ node-inspector --hidden='["node_modules/framework"]'Note that the array items are interpreted as regular expressions.
Making Node Inspector the best debugger for node.js cannot be achieved without the help of the community. The following resources should help you to get started.
Danny Coates for starting the project and maintaining it for several years.
StrongLoop for upgrading to the Blink front-end and maintaining the project onwards.
And of course all developers that contributed patches and features, as listed in the AUTHORS file.
| Back | FazBrowse Home | New Git URL |