osxreachability
osxreachability allows to monitor a Mac's network reachability
Example usage:
const reach = require('osxreachability');
...
reach.Reachability.start(function(state){
switch(state) {
case reach.NOT_REACHABLE:
// ...
break;
case reach.REACHABLE_WIFI:
// ...
break;
}
});
...
reach.Reachability.stop();
It is important to call stop() in order to release the native reachability monitor's resources!