luci-rpc
v1.0.5
Published
A package that helps communicate with the luci-mod-rpc interface
Downloads
29
Readme
luci-rpc
A simple RPC communication library for the JSON LUCI RPC API.
Example
const { LUCI } = require('luci-rpc')
async function main() {
const luci = new LUCI('https://192.168.1.2', 'root', 'x')
await luci.init()
let updateInterval = 1000 * 60 * 30
luci.autoUpdateToken(updateInterval);
console.log(await luci.getAll("network"))
console.log(await luci.get(["network", "@device[0]", "ports"]))
await luci.set(["network", "lan", "ipaddr", "192.168.1.1"])
console.log(await luci.getChangedSections())
console.log(await luci.getChanges())
console.log(await luci.commit("network"))
console.log(await luci.commitSpecific(["network", "lan"]))
}
main()
LICENSE
GPL-3.0