1.0.5 • Published 2 years ago

luci-rpc v1.0.5

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
2 years ago

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

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago