All notable changes to lua-state will be documented here.
Both npm package versions (packageVersion) and native binary versions (nativeVersion) are tracked.
LuaState#close()method to explicitly free native memoryERR_LUA_STATE_CLOSEDerror code for operations on closed state
- Breaking: CLI command
lua-state installrenamed tolua-state build. The old name was misleading — the command actually builds a native binary rather than installing anything. Uselua-state build(e.g.npx lua-state build --mode=official --version=5.2.4). - Breaking:
--forceremoved. Use--mode=officialto download and compile official Lua sources instead of a prebuilt binary. - Operations on a closed state now throw a dedicated
LuaStateError(a JS API-layer error class) instead of a genericError.LuaStateErrorextendsErrorand is distinct fromLuaError. buildnow always produces a fresh binary instead of silently reusing an existing one; added--skip-if-exists(alsoLUA_STATE_SKIP_IF_EXISTS) to skip the rebuild whenbuild/Release/lua-state.nodeis already present — used by the npminstallhook. It is orthogonal to--out/--prebuild, which still copy the existing binary.- Added
--prebuild [path]option tolua-state build— builds into the standardprebuilds/{platform}-{arch}/lua-state[.glibc|.musl].nodelayout for the current platform, compatible withnode-gyp-buildandprebuildify. Takes priority over--out. - Added
--out <path>option tolua-state buildas a low-level alternative to copy the built binary to an exact path (parent directories are created automatically). - Added
npm run buildscript alias.
- Lua
stack overflowunder sustained load - added aStackGuardthat unwinds the Lua stack after every operation - Error handling compatibility with Lua 5.1
- Dangling pointer in
LuaToJsConverterwhen objects map rehashes
- Reorganized
src/intocore/,conversion/,napi/,runtime/subdirectories - Extracted JS↔Lua value conversion into dedicated
JsToLuaConverterandLuaToJsConvertercomponents - Added
NapiStringBufferfor fast string key handling JsObjectLuaRefCachewith vector-to-map strategy switch (avoids allocation for small object graphs)- Removed
std::function-basedFunctionFactorydispatch from hot paths - Build configuration with debugging support
- Added docs for
LuaState#close()in README
- Lua errors now preserve non-string values passed to
error(...)viaLuaError#cause LuaError#stacknow contains a formatted Lua traceback (instead of a raw value)- Calling
error({ ... })no longer replaces the error message with"Unknown Lua error"
LuaError#causefor non-string Lua error values
- Resolve relative paths in CLI install
- Fix error on install cli-command when binary is not found
- Fix wrong options keys in CLI install
- Support for multiple return values from JS functions
- Error handling when calling JS functions from Lua
- Updated README with examples for JS function calls and error handling
- Add run bin command
- Refactor lua-state bin command with commander package
- Refactor README
- Add "null" to LuaPrimitive and replace return "undefined" to "void" in LuaFunction
- Added support for Date and BigInt
- Improved package metadata for npm search and discoverability
- Minor README improvements
- Initial stable release 🎉
- Lua 5.1–5.4 and LuaJIT support via native bindings
- CLI installer (
lua-state install) - Full TypeScript support