This project is not maintained anymore. The code does not run on node 4+ and I don't have time and moot to fix that.
I reommend the debugger from Visual Studio Code as a great replacement:
gulp-node-debug
A wrapper around node-inspector for gulp, has the same functionality as the node-debug command.
Perfect for development. Easy to use.
- Runs node-inspector.
- Runs the supplied script in debug mode
- Opens the user's browser, pointing it at the inspector.
Installation
npm install gulp-node-debug --save-dev
Usage
This is the minimal setup. The file app.js
will be debugged with default values.
// gulpfile.jsvar gulp = ;var nodeDebug = ;gulp;
Add debugBrk: true
if your script finishes immediately:
// gulpfile.jsvar gulp = ;var nodeDebug = ;gulp;
This example shows all available options (default values):
// gulpfile.jsvar gulp = ;var nodeDebug = ;gulp;
Enter gulp debug
in your shell to start the node-inspector, run the supplied script and to open the debug URL in Chrome, Chromium or Opera.
How to debug Mocha unit-tests?
You have to start _mocha as the debugged process. Try out the watch option, which makes sure that the debugged process does not end after execution of all tests.
// gulpfile.jsvar gulp = ;var nodeDebug = ;gulp;
Options
All options are written in camelCase style:
Option | Default | Description |
---|---|---|
debugPort | 5858 | Node/V8 debugger port. |
webHost | '0.0.0.0' | Host to listen on for Node Inspector's web interface. node-debug listens on 127.0.0.1 by default. |
webPort | 8080 | Port to listen on for Node Inspector's web interface. |
node-debug | ||
debugBrk | true | Break on the first line. |
nodejs | [] | List of string to pass NodeJS options to debugged process. |
script | [] | List of string to pass options to debugged process. |
node-inspector | ||
saveLiveEdit | false | Save live edit changes to disk (update the edited files). |
preload | true | Preload *.js files. You can disable this option to speed up the startup. |
inject | true | Enable injection of debugger extensions into the debugged process. |
hidden | [] | Array of files to hide from the UI, breakpoints in these files will be ignored. All paths are interpreted as regular expressions. |
stackTraceLimit | 50 | Number of stack frames to show on a breakpoint. |
sslKey | '' | Path to file containing a valid SSL key. |
sslCert | '' | Path to file containing a valid SSL certificate. |
Credits
This project was forked from gulp-node-inspector which wraps node-inspector (but does not start a debugged process). All real work was done by node-inspector.
License
The MIT License (MIT)
Copyright (c) 2015 Johannes Hoppe (http://haushoppe-its.de)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.