Reloady
Automatically re-execute code when it changes, from anywhere in your code.
Great for:
- checkpointing while debugging slow tests (think browser tests)
- live-coding with node.js
Usage
yarn add --dev reloady
Reloady can be initialized anywhere in your code. Just give it:
- an absolute path to a module with a function as a default export
- an optional argument to call the function with
Example:
const reloady = ; async { const foo = 1; const bar = 2; await ; };
Reloady returns a promise that never resolves, so you can await
it as a sort of persistent debugger.
Now every time you change ./debug.js
, the module will be re-required and re-invoked with its given arguments.
// ./debug.js moduleexports = async { console; // 1 await ; console; // 2}