# wpa-conf-codec Convert [wpa_supplicant.conf] <-> JSON ```js var fs = require('fs') var wpa = require('wpa-conf-codec') var conf = fs.readFileSync('/etc/wpa_supplicant/wpa_supplicant.conf') console.log(conf.decode(conf)) console.log(conf.encode(conf.decode(conf))) ``` ## API ### `wpa.decode(str): obj` Decode wpa config - `str`: string of `wpa_supplicant.conf` data - `obj`: config converted into a JS object ### `wpa.encode(obj): str` Encode wpa config - `obj`: config as a JS object - `str`: string of `obj` converted into `wpa_supplicant.conf` format ### CLI A command-line program is provided that converts between a config in `wpa_supplicant.conf` format and JSON format, using standard I/O. - `wpa-conf decode`: convert conf to json - `wpa-conf encode`: convert json to conf [wpa_supplicant.conf]: https://w1.fi/cgit/hostap/tree/wpa_supplicant/wpa_supplicant.conf [POJOs]: http://odetocode.com/blogs/scott/archive/2012/02/27/plain-old-javascript.aspx ## License Copyright (c) 2017 @f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519 Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument. DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.