Mount Watcher
Get notified when a filesystem is mounted/unmounted! (Linux only)
Key features:
- Uses
epollto watch/proc/mountsin an efficient way: no busy polling. - Emits high-level events with the newly mounted/unmounted filesystems.
- Can be stopped from the event handler, or from the outside.
- Can coalesce multiple events into one, on demand.
Example
let watch = new;
// store the watcher somewhere (it will stop on drop)