What is luajls?

luajls is a set of Lua modules for developing stand-alone Lua applications.

The modules provide general-purpose functions such as class definition and promise, to operating system abstractions such as file system and network access. The modules support asynchronous I/O based on event loops.

Lua
Lua
Stand-alone
C and Lua
modules
[Not supported by viewer]
Dependent
Lua
modules
[Not supported by viewer]
luajls
[Not supported by viewer]
net
net
io
io
lang
[Not supported by viewer]
util
util
zip
zip
http
http
luaclibs
[Not supported by viewer]
libuv
libuv
openssl
openssl
webview
webview

The main targeted OSes are Linux and Windows. The only required dependency is Lua 5.4 Other dependencies are Lua native modules such as lfs, luasocket, luv, lua-openssl, lua-cjson.

What are the features?

The following packages are available.

File system manipulation, file I/O, stream handlers, pipe, serial
Base classes including class definition, module loading, promises, logging, event loop, process, thread
Network classes including TCP and UDP socket, HTTP, MQTT, WebSocket client and server
Utility classes for date and time, JSON format, hash functions, deflate, gzip, tar, zip file and WebView

What does it look like?

The following is the hello world HTTP server script.

local event = require('jls.lang.event')
local HttpServer = require('jls.net.http.HttpServer')

local hostname, port = '::', 3001
local httpServer = HttpServer:new()
httpServer:bind(hostname, port):next(function()
  print('Server bound to "'..hostname..'" on port '..tostring(port))
end)
httpServer:createContext('/', function(httpExchange)
  local response = httpExchange:getResponse()
  response:setBody([[<!DOCTYPE html>
  <html>
    <body>
      <p>It works !</p>
    </body>
  </html>
  ]])
end
)
event:loop()

What do you want to do?

> Browse the documentation
> Download luajls
> Browse the Lua JLS source code
> Browse the Lua C libraries
> Give a feedback or report a bug



Powered by