Debugging Node.js Assistive Tools (nodewatcher) _javascript tips

Source: Internet
Author: User
It appears that Fs.watchfile is not supported on Windows platforms. I didn't want to use IIS NODE, so I spent a little time writing a little tool to help with debugging.
This tool can do:
Monitor changes to all subdirectories related files under the main JS file. Restart node process with changes
The log can be exported to this tool for easy viewing in the browser.
usage:
NodeWatcher.exe Main.js
All parameters:
Copy Code code as follows:

NodeWatcher.exe main JS program [other optional parameters]
The main JS program must be specified. Equivalent to node main JS program
-r: [true | false] automatically restarts when an error occurs (the node process exits).
Example: Nodewatcher.exe-r false
-E: Files for which suffix names are monitored in the monitored directory. JS and node by default
Example: Nodewatcher.exe-w lib-e js-e node-e json-e Config
-?:
-help: Displaying Help documents

Log output to view Web pages
http://localhost:2012/
The following figure:

Node.js to the tool output log, you can use the Console.log series statements can also invoke the method provided by the tool.
tools provided by:
1 Download Http://localhost:2012/logger.js to the root directory of the project
2 reference require ("./logger.js")
3 Call:
Logger.log (...)
Logger.error ()
Logger.info ()
Logger.warn ()
Logger.exception (e)
The argument can be a string or an object, and if it is an object, it will output its first-level attribute.


Installation:
You don't need to install it, but you have a. Net framework on your computer. I was compiled with 2.0. It's OK to download the NodeWatcher.exe and put it in the directory.
Download Address: 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.