Nodemon and node-inspector are two must-have tools if you’re using node.js. You can manually start nodemon or node-inspector using two separate console windows, or you can do it a more efficiently using gulp.js. It took me some time to get everything setup the way I wanted it so I’m hoping this post will save you some effort.
Assuming your using gulp.js as your build system, lets install both gulp-nodemon and gulp-node-inspector using npm. I prefer to install the files locally to the project, but if you like you can install them globally using the
-g flag. Use your console to navigate to your project folder, and run the following commands:
$ npm install gulp-nodemon --save-dev
$ npm install gulp-node-inspector --save-dev
After your plugins are installed we need to setup your gulpfile.js.
You’re all set, just type
$ gulp in your console. If you use the same settings in this gulpfile.js, and your app is running on port 3000 you can open
http://127.0.0.1:3000/ to access your webserver and
http://127.0.0.1:8080/?port=5858 to access your node debugger.
To download the example used in this project you can checkout the files on Github.
For more information: