ExtMongo is a web-based admin interface for mongodb using nodeJS.
-
With npm
$ npm install -g extmongo
-
start the inspector. I usually put it in the background
$ extmongo &
-
open http://127.0.0.1:5000/ in your favorite web browser
-
you should now see the mongodb databases listed.
-
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 Safari and Chrome. Here's a good overview of the UI
-
I don't see one of my script files in the file list.
try refreshing the browser (F5 or command-r)
-
My script runs too fast to attach the debugger.
use
--debug-brk
to pause the script on the first line -
I got the ui in a weird state.
when in doubt, refresh
-
Can I debug remotely?
Yes. node-inspector must be running on the same machine, but your browser can be anywhere. Just make sure port 8080 is accessible
--port=[port] port to host the extmongo (default 5000)
- the WebKit Web Inspector debugger is a great js debugger interface, it works just as well for node
- uses WebSockets, so no polling for breaks
- remote debugging
- javascript top to bottom :)
- edit running code
This is beta quality code, so use at your own risk:
- be careful about viewing the contents of Buffer objects, each byte is displayed as an individual array element, for anything but tiny Buffers this will take too long to render
- while not stopped at a breakpoint the console doesn't always behave as you might expect
VERY EXPERIMENTAL I don't recommend using this yet
To use the profiles panel, install the v8-profiler module:
npm install v8-profiler
To use it do something like:
var profiler = require('v8-profiler');
profiler.startProfiling('startup');
slowStartupFoo();
profiler.stopProfiling('startup');
profiler.takeSnapshot('beforeLeak');
leakyFoo();
profiler.takeSnapshot('afterLeak');
Then view the profiling results with the profiles panel in node-inspector. You can also take heap snapshots on demand from the profiles panel.
This project respectfully uses code from and thanks the authors of:
and ICONs of: