Luver is a bare-bones alternative to luvit that uses lit's luvit-loader instead of Luvit's require.
- No built-in libraries or dependencies other than
luvit-loaderand luv/luvi - No exports table (or any other globals except for
arg) - No circular requires allowed
luver takes a Lua script as its first parameter (luver path/to/script.lua). It will simply execute that script and start the libuv event loop for you.
-- test.lua
local uv = require('uv')
local handle = uv.new_timer()
local delay = 1000
local function ontimeout()
uv.timer_stop(handle)
uv.close(handle)
print("Test")
end
uv.timer_start(handle, delay, 0, ontimeout)Running luver test.lua would output "Test" after one second and then exit.
If you have Lit installed, you can build Luver by executing:
lit make github://squeek502/luverBuilding luver is easy and works cross-platform thanks to Makefile and make.bat.
git clone https://github.com/squeek502/luver.git
cd luver
makeIf you want to use luver without constantly building, use luvi.
cd luver
luvi . -- path/to/script.lua