From cfacdd6438beb387a8e8f266e3b8a1eb19c67db0 Mon Sep 17 00:00:00 2001 From: Christian Kuster Date: Fri, 9 Dec 2016 17:53:43 +0100 Subject: [PATCH] node 4 compliant again --- index.js | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index 3153032..8a05da1 100644 --- a/index.js +++ b/index.js @@ -21,25 +21,39 @@ function initTools(callback) { // the error into the result and check it later on. async.parallel([ function (cb) { - exec(airport.detector, err => cb(null, {err: err, scanner: airport})); + exec(airport.detector, function (err) { + cb(null, {err: err, scanner: airport} + ) + } + ); }, function (cb) { - exec(iwlist.detector, err => cb(null, {err: err, scanner: iwlist})); + exec(iwlist.detector, function (err) { + cb(null, {err: err, scanner: iwlist} + ) + } + ); }, function (cb) { - exec(netsh.detector, err => cb(null, {err: err, scanner: netsh})); + exec(netsh.detector, function (err) { + cb(null, {err: err, scanner: netsh} + ) + } + ); } ], function (err, results) { - let res = _.find(results, f => { - return !f.err - }); + var res = _.find(results, + function (f) { + return !f.err + }); if (res) { return callback(null, res.scanner); } callback(new Error('No scanner found')); - }); + } + ); } /** @@ -63,7 +77,7 @@ module.exports = { */ scan: function (callback) { if (!scanner) { - initTools((err, s) => { + initTools(function (err, s) { if (err) { return callback(err); }