node-hot-reload
Utility code for watching source files for changes and reloading modules
Installation:
npm install hot-reload --global
Usage
Command Line Interface Usage
hot-reload [main-script]
Configuration
The hot-reload
CLI will load its configuration from <cwd>/hot-reload.json
. A sample configuration is shown below:
"watch": "config/" "src/" "init-app.js" "routes.js" "package.json" "logging-enabled": true "plugins": "hot-reload-uncache-modules": "enabled": true "uncache": "*" // Uncache all cached Node modules "./hot-reload": "enabled": true
Plugins
A plugin is implemented as a module that exports a function as shown in the sample plugin below:
var server = ;var nodePath = ; module { hotReload; hotReload;};
JavaScript API Usage
Example Usage:
start;