diff --git a/hostapd.js b/hostapd.js index 08879db..e005535 100644 --- a/hostapd.js +++ b/hostapd.js @@ -54,8 +54,8 @@ var hostapd = module.exports = { * }); * */ -function disable(interface, callback) { - var file = interface + '-hostapd.conf'; +function disable(interface_, callback) { + var file = interface_ + '-hostapd.conf'; return this.exec('kill `pgrep -f "^hostapd -B ' + file + '"` || true', callback); diff --git a/ifconfig.js b/ifconfig.js index 08f9fa7..3013f0b 100644 --- a/ifconfig.js +++ b/ifconfig.js @@ -187,12 +187,12 @@ function parse_status_interface(callback) { * ] * */ -function status(interface, callback) { +function status(interface_, callback) { if (callback) { - this.exec('ifconfig ' + interface, parse_status_interface(callback)); + this.exec('ifconfig ' + interface_, parse_status_interface(callback)); } else { - this.exec('ifconfig -a', parse_status(interface)); + this.exec('ifconfig -a', parse_status(interface_)); } } @@ -213,8 +213,8 @@ function status(interface, callback) { * }); * */ -function down(interface, callback) { - return this.exec('ifconfig ' + interface + ' down', callback); +function down(interface_, callback) { + return this.exec('ifconfig ' + interface_ + ' down', callback); } /** diff --git a/iw.js b/iw.js index 000a825..0b5239a 100644 --- a/iw.js +++ b/iw.js @@ -179,14 +179,14 @@ function parse_scan(show_hidden, callback) { * @param {function} callback The callback function. */ function scan(options, callback) { - var interface, show_hidden + var interface_, show_hidden if (typeof options === 'string') { - var interface = options; + var interface_ = options; var show_hidden = false; } else { - var interface = options.iface; + var interface_ = options.iface; var show_hidden = options.show_hidden || false; } - this.exec('iw dev ' + interface + ' scan', parse_scan(show_hidden, callback)); + this.exec('iw dev ' + interface_ + ' scan', parse_scan(show_hidden, callback)); } diff --git a/iwconfig.js b/iwconfig.js index fb2f5fd..1d7fb85 100644 --- a/iwconfig.js +++ b/iwconfig.js @@ -174,12 +174,12 @@ function parse_status_interface(callback) { * ] * */ -function status(interface, callback) { +function status(interface_, callback) { if (callback) { - return this.exec('iwconfig ' + interface, + return this.exec('iwconfig ' + interface_, parse_status_interface(callback)); } else { - return this.exec('iwconfig', parse_status(interface)); + return this.exec('iwconfig', parse_status(interface_)); } } diff --git a/iwlist.js b/iwlist.js index 206506b..37b363d 100644 --- a/iwlist.js +++ b/iwlist.js @@ -291,12 +291,12 @@ function parse_scan(show_hidden, callback) { * */ function scan(options, callback) { - var interface, show_hidden + var interface_, show_hidden if (typeof options === 'string') { - var interface = options; + var interface_ = options; var show_hidden = false; } else { - var interface = options.iface; + var interface_ = options.iface; var show_hidden = options.show_hidden || false; } @@ -306,5 +306,5 @@ function scan(options, callback) { extra_params = ' essid ' + options.ssid; } - this.exec('iwlist ' + interface + ' scan' + extra_params, parse_scan(show_hidden, callback)); + this.exec('iwlist ' + interface_ + ' scan' + extra_params, parse_scan(show_hidden, callback)); } diff --git a/package.json b/package.json index 9fc9a6c..0ecea70 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,56 @@ { - "name": "wireless-tools", - "version": "0.19.0", + "_from": "wireless-tools@^0.19.0", + "_id": "wireless-tools@0.19.0", + "_inBundle": false, + "_integrity": "sha1-Z/tzzTcfLZujue8lNACjH4x4SxE=", + "_location": "/wireless-tools", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "wireless-tools@^0.19.0", + "name": "wireless-tools", + "escapedName": "wireless-tools", + "rawSpec": "^0.19.0", + "saveSpec": null, + "fetchSpec": "^0.19.0" + }, + "_requiredBy": [ + "/pi-wifi" + ], + "_resolved": "https://registry.npmjs.org/wireless-tools/-/wireless-tools-0.19.0.tgz", + "_shasum": "67fb73cd371f2d9ba3b9ef253400a31f8c784b11", + "_spec": "wireless-tools@^0.19.0", + "_where": "/home/pi/pdac/pdac-frontend/node_modules/pi-wifi", + "author": { + "name": "Christopher M. Baker" + }, + "bugs": { + "url": "https://github.com/bakerface/wireless-tools/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Athom", + "email": "support@athom.com", + "url": "https://www.athom.com/en/" + }, + { + "name": "Wink", + "email": "support@wink.com", + "url": "https://www.wink.com/" + } + ], + "deprecated": false, "description": "Wireless tools for Node.js", - "author": "Christopher M. Baker", - "license": "MIT", + "devDependencies": { + "codeclimate-test-reporter": "^0.3.1", + "istanbul": "^0.4.3", + "mocha": "^2.5.3", + "should": "^9.0.2", + "xo": "^0.16.0" + }, "homepage": "https://github.com/bakerface/wireless-tools", - "main": "wireless-tools.js", "keywords": [ "wireless", "tools", @@ -18,38 +63,20 @@ "udhcpd", "wpa_supplicant" ], + "license": "MIT", + "main": "wireless-tools.js", + "name": "wireless-tools", "repository": { "type": "git", - "url": "https://github.com/bakerface/wireless-tools.git" - }, - "bugs": { - "url": "https://github.com/bakerface/wireless-tools/issues" + "url": "git+https://github.com/bakerface/wireless-tools.git" }, "scripts": { - "test": "istanbul cover node_modules/.bin/_mocha", + "codeclimate": "codeclimate-test-reporter < coverage/lcov.info", "posttest": "istanbul check-coverage --statements 100 --functions 100 --branches 100 --lines 100", - "codeclimate": "codeclimate-test-reporter < coverage/lcov.info" + "test": "istanbul cover node_modules/.bin/_mocha" }, + "version": "0.19.0", "xo": { "space": true - }, - "devDependencies": { - "codeclimate-test-reporter": "^0.3.1", - "istanbul": "^0.4.3", - "mocha": "^2.5.3", - "should": "^9.0.2", - "xo": "^0.16.0" - }, - "contributors": [ - { - "name": "Athom", - "email": "support@athom.com", - "url": "https://www.athom.com/en/" - }, - { - "name": "Wink", - "email": "support@wink.com", - "url": "https://www.wink.com/" - } - ] + } } diff --git a/udhcpc.js b/udhcpc.js index 32cc5c5..b2aca4b 100644 --- a/udhcpc.js +++ b/udhcpc.js @@ -55,8 +55,8 @@ var udhcpc = module.exports = { * }); * */ -function disable(interface, callback) { - var command = 'kill `pgrep -f "^udhcpc -i ' + interface + '"` || true'; +function disable(interface_, callback) { + var command = 'kill `pgrep -f "^udhcpc -i ' + interface_ + '"` || true'; return this.exec(command, callback); } diff --git a/udhcpd.js b/udhcpd.js index 006cedf..b493d6d 100644 --- a/udhcpd.js +++ b/udhcpd.js @@ -140,7 +140,7 @@ function enable(options, callback) { * }); * */ -function disable(interface, callback) { - var file = interface + '-udhcpd.conf'; +function disable(interface_, callback) { + var file = interface_ + '-udhcpd.conf'; return this.exec('kill `pgrep -f "^udhcpd ' + file + '"` || true', callback); } diff --git a/wpa_cli.js b/wpa_cli.js index f4fa8fb..5266fd4 100644 --- a/wpa_cli.js +++ b/wpa_cli.js @@ -297,19 +297,19 @@ function parse_scan_results_interface(callback) { * OK * */ -function status(interface, callback) { - var command = [ 'wpa_cli -i', interface, 'status'].join(' '); +function status(interface_, callback) { + var command = [ 'wpa_cli -i', interface_, 'status'].join(' '); return this.exec(command, parse_status_interface(callback)); } -function bssid(interface, ap, ssid, callback) { - var command = ['wpa_cli -i', interface, 'bssid', ssid, ap].join(' '); +function bssid(interface_, ap, ssid, callback) { + var command = ['wpa_cli -i', interface_, 'bssid', ssid, ap].join(' '); return this.exec(command, parse_command_interface(callback)); } -function reassociate(interface, callback) { +function reassociate(interface_, callback) { var command = ['wpa_cli -i', - interface, + interface_, 'reassociate'].join(' '); return this.exec(command, parse_command_interface(callback)); @@ -326,9 +326,9 @@ function reassociate(interface, callback) { // enable_network: enable_network */ -function set(interface, variable, value, callback) { +function set(interface_, variable, value, callback) { var command = ['wpa_cli -i', - interface, + interface_, 'set', variable, value ].join(' '); @@ -336,17 +336,17 @@ function set(interface, variable, value, callback) { return this.exec(command, parse_command_interface(callback)); } -function add_network(interface, callback) { +function add_network(interface_, callback) { var command = ['wpa_cli -i', - interface, + interface_, 'add_network' ].join(' '); return this.exec(command, parse_command_interface(callback)); } -function set_network(interface, id, variable, value, callback) { +function set_network(interface_, id, variable, value, callback) { var command = ['wpa_cli -i', - interface, + interface_, 'set_network', id, variable, @@ -355,61 +355,61 @@ function set_network(interface, id, variable, value, callback) { return this.exec(command, parse_command_interface(callback)); } -function enable_network(interface, id, callback) { +function enable_network(interface_, id, callback) { var command = ['wpa_cli -i', - interface, + interface_, 'enable_network', id ].join(' '); return this.exec(command, parse_command_interface(callback)); } -function disable_network(interface, id, callback) { +function disable_network(interface_, id, callback) { var command = ['wpa_cli -i', - interface, + interface_, 'disable_network', id ].join(' '); return this.exec(command, parse_command_interface(callback)); } -function remove_network(interface, id, callback) { +function remove_network(interface_, id, callback) { var command = ['wpa_cli -i', - interface, + interface_, 'remove_network', id ].join(' '); return this.exec(command, parse_command_interface(callback)); } -function select_network(interface, id, callback) { +function select_network(interface_, id, callback) { var command = ['wpa_cli -i', - interface, + interface_, 'select_network', id ].join(' '); return this.exec(command, parse_command_interface(callback)); } -function scan(interface, callback) { +function scan(interface_, callback) { var command = ['wpa_cli -i', - interface, + interface_, 'scan'].join(' '); return this.exec(command, parse_command_interface(callback)); } -function scan_results(interface, callback) { +function scan_results(interface_, callback) { var command = ['wpa_cli -i', - interface, + interface_, 'scan_results'].join(' '); return this.exec(command, parse_scan_results_interface(callback)); } -function save_config(interface, callback) { +function save_config(interface_, callback) { var command = ['wpa_cli -i', - interface, + interface_, 'save_config'].join(' '); return this.exec(command, parse_command_interface(callback)); diff --git a/wpa_supplicant.js b/wpa_supplicant.js index 6316d02..ad1fbcf 100644 --- a/wpa_supplicant.js +++ b/wpa_supplicant.js @@ -56,9 +56,9 @@ var wpa_supplicant = module.exports = { * }); * */ -function disable(interface, callback) { +function disable(interface_, callback) { var command = 'kill `pgrep -f "wpa_supplicant -i ' + - interface + ' .*"` || true'; + interface_ + ' .*"` || true'; return this.exec(command, callback); }