npm.io
0.3.2 • Published 9 years ago

osxreachability

Licence
MIT
Version
0.3.2
Deps
3
Vulns
0
Weekly
0
Install scriptsThis package runs scripts during installation (preinstall/install/postinstall)

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!