vantage-watch
Listens for changes in Vantage.js extension files, and reloads the extensions without interrupting your app's lifecycle.
Useful when developing new Vantage commands.
Installation
npm install vantage-watchnpm install vantage
Usage
const Vantage = ;const watch = ;const commands = ; let vantage = ; vantage ;
Now, whenever ./lib/vantage-commands.js
is changed, Vantage will import and update its existing commands and / or register new commands.
Error Handling
If the watched file is not a valid Vantage extension, vantage-watch
will gracefully catch the error and not attempt to load the module until it has been changed again, at which point it will retry. Examples of invalid imports include:
- Its
module.exports
does not return a function - It has syntax errors
- It is not a valid file
License
MIT