index.js
function initTools(callback) {

  // When a command is not found, an error is issued and async would finish. Therefore we pack
  // the error into the result and check it later on.
  async.parallel([
      function (cb) {
        exec(airport.detector, function (err) {
            cb(null, {err: err, scanner: airport}
            )
          }
        );
      },
      function (cb) {
        exec(iwlist.detector, function (err) {
            cb(null, {err: err, scanner: iwlist}
            )
          }
        );
      },
      function (cb) {
        exec(netsh.detector, function (err) {
            cb(null, {err: err, scanner: netsh}
            )
          }
        );
      }
    ],
    function (err, results) {
      var res = _.find(results,
        function (f) {
          return !f.err
        });

      if (res) {
        return callback(null, res.scanner);
      }
      callback(new Error('No scanner found'));
    }
  );
}
function initTools(callback) {

  // When a command is not found, an error is issued and async would finish. Therefore we pack
  // the error into the result and check it later on.
  async.parallel([
      function (cb) {
        exec(airport.detector, function (err) {
            cb(null, {err: err, scanner: airport}
            )
          }
        );
      },
      function (cb) {
        exec(iwlist.detector, function (err) {
            cb(null, {err: err, scanner: iwlist}
            )
          }
        );
      },
      function (cb) {
        exec(netsh.detector, function (err) {
            cb(null, {err: err, scanner: netsh}
            )
          }
        );
      }
    ],
    function (err, results) {
      var res = _.find(results,
        function (f) {
          return !f.err
        });

      if (res) {
        return callback(null, res.scanner);
      }
      callback(new Error('No scanner found'));
    }
  );
}
function initTools ( callback ) { // When a command is not found, an error is issued and async would finish. Therefore we pack // the error into the result and check it later on. async . parallel ( [ function ( cb ) { exec ( airport . detector , function ( err ) { cb ( null , { err : err , scanner : airport } ) } ) ; } , function ( cb ) { exec ( iwlist . detector , function ( err ) { cb ( null , { err : err , scanner : iwlist } ) } ) ; } , function ( cb ) { exec ( netsh . detector , function ( err ) { cb ( null , { err : err , scanner : netsh } ) } ) ; } ] , function ( err , results ) { var res = _ . find ( results , function ( f ) { return ! f . err } ) ; if ( res ) { return callback ( null , res . scanner ) ; } callback ( new Error ( 'No scanner found' ) ) ; } ) ; }
Initializing the tools
Initializing the tools