Debug Node. JS's auxiliary tool (NodeWatcher)

Source: Internet
Author: User

It seems that fs. watchfile is not supported in Windows. I don't want to use iis node, so I spent some time writing a tool to help debug.
This tool can do the following:
Monitors changes to all subdirectories in the main js file. restarts the Node process after changes are made.
Logs can be output to this tool for viewing in the browser.
Usage:
NodeWatcher.exe main. js
All parameters: Copy codeThe Code is as follows: NodeWatcher.exe main JS program [other optional parameters]
The main JS program must be specified.
-R: [true | false] automatically restarts when an error occurs (node process exits.
Example: NodeWatcher.exe-r false
-E: Which suffix files are to be monitored in the monitored directory. js and node files are used by default.
Example: NodeWatcher.exe-w lib-e js-e node-e json-e xml-e config
-? :
-Help: displays help documents.

Log output allows you to view web pages
Http: // localhost: 2012/
For example:

Node. JS outputs logs to the tool. You can use the console. log statements or call the methods provided by the tool.
Methods provided by the tool:
1 download http: // localhost: 2012/logger. js to the project root directory
2 reference require ("./logger. js ")
3 call:
Logger. log (....)
Logger. error ()
Logger.info ()
Logger. warn ()
Logger. exception (e)
A parameter can be a string or an object. If it is an object, its first-level attribute is output.

Installation:
You don't need to install it, but you need to have. Net framework on your computer. I compiled it with 2.0. Download NodeWatcher.exe and put it in the directory.
: NodeWatcher_jb51.net.rar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.