wpa-editor

1.0.1 • Public • Published

wpa-editor

Install

npm install wpa-editor -save 

Description

Scan and edit wpa supplicant config file from NodeJS.

How to use

const wpa = require("wpa-editor");
var wifi = new wpa();
//scan and return all ssid visible in array
wifi.scan(function(err, res){
    console.log(res);
})
//edit wpa-supplicant config file (/etc/wpa_supplicant/wpa_supplicant.conf)
//param: SSID[string], password[string]
wifi.editWPA("test","test1234", function(err){
    console.log(err);
});

Options

var wifi = new wpa({
    {
        interfaces : "wlan0", //Default wifi interface
        configFilePathname : "/etc/wpa_supplicant/wpa_supplicant.conf", //wpa-supplicant config file location
        regex : /^\nnetwork=(.|\n|\r){1,}\}$/gm //parse network in file location
    }
});

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i wpa-editor

      Weekly Downloads

      1

      Version

      1.0.1

      License

      ISC

      Unpacked Size

      3.75 kB

      Total Files

      3

      Last publish

      Collaborators

      • emmo30