LuCI - OpenWrt Configuration Interface
The ucode-mod-lua library provides an ucode-to-Lua bridge and a set of functions to instantiate Lua VMs, invoke Lua functions as well as exchanging data structures between ucode and Lua. Example usage: #!/usr/bin/ucode 'use strict'; const lua = require("lua"); let vm = lua.create(); vm.set({ hello: function(...args) { print(`A ucode "Hello world" function called from Lua! Got arguments: ${args}\n`); }, data_from_ucode: { bool: true, float: 1.3, int: 0x11223344, string: "Hello from ucode!", array: [ 1, 2, 3, null, 5 ], object: { apple: "green", banana: "yellow", [5]: "foo", [-1]: null, nested: { a: [ 5, 6 ], b: { c: NaN } } }, regexp: /foo/ } }); vm.invoke("hello", true, 123, "Foo"); vm.eval('print("Print from Lua!", data_from_ucode.int * data_from_ucode.float);'); try { vm.invoke("error", "Throwing a Lua exception..."); } catch (e) { print(`Caught exception: ${e}\n`); } print(`Lua VM version is: ${vm.get('_G', '_VERSION').value()}\n`); Signed-off-by: Jo-Philipp Wich <jo@mein.io> |
||
---|---|---|
.github | ||
applications | ||
build | ||
collections | ||
contrib/package | ||
docs | ||
libs | ||
modules | ||
protocols | ||
themes | ||
.gitignore | ||
CONTRIBUTING.md | ||
jsdoc.conf.json | ||
LICENSE | ||
luci.mk | ||
NOTICE | ||
package.json | ||
README.md |
OpenWrt luci feed
Description
This is the OpenWrt "luci"-feed containing LuCI - OpenWrt Configuration Interface.
Usage
This feed is enabled by default. Your feeds.conf.default (or feeds.conf) should contain a line like:
src-git luci https://github.com/openwrt/luci.git
To install all its package definitions, run:
./scripts/feeds update luci
./scripts/feeds install -a -p luci
API Reference
You can browse the generated API documentation directly on Github.
Development
Documentation for developing and extending LuCI can be found in the Wiki
License
See LICENSE file.
Package Guidelines
See CONTRIBUTING.md file.