{"id":51069206,"url":"https://github.com/lde-org/lua-sys","last_synced_at":"2026-06-23T09:02:00.899Z","repository":{"id":364923315,"uuid":"1261072508","full_name":"lde-org/lua-sys","owner":"lde-org","description":"LuaJIT C Api bindings for LuaJIT","archived":false,"fork":false,"pushed_at":"2026-06-15T05:15:57.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-15T06:21:02.926Z","etag":null,"topics":["lua","lua-bindings","luajit","scripting"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lde-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-06T07:44:42.000Z","updated_at":"2026-06-15T05:17:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lde-org/lua-sys","commit_stats":null,"previous_names":["lde-org/lua-sys"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/lde-org/lua-sys","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lde-org%2Flua-sys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lde-org%2Flua-sys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lde-org%2Flua-sys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lde-org%2Flua-sys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lde-org","download_url":"https://codeload.github.com/lde-org/lua-sys/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lde-org%2Flua-sys/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34682633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lua","lua-bindings","luajit","scripting"],"created_at":"2026-06-23T09:01:59.965Z","updated_at":"2026-06-23T09:02:00.888Z","avatar_url":"https://github.com/lde-org.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lua-sys\n\nBindings for the Lua C Api (specifically LuaJIT) for [lde](https://lde.sh/).\n\nIt adds both a raw api (accessible via `require(\"lua-sys\").raw`) which are raw bindings to the C api practically verbatim, alongside a higher level api that abstracts away the stack based Lua api for more idiomatic usage.\n\n## Why is this useful?\n\nFor creation of isolated lua states that you can sandbox properly rather than running lua code and attempting to sandbox it via fenv/debug.sethook/etc isolation.\n\nAlso, allows sandboxed scripts to not affect your main lua state's ffi bindings.\n\n## Usage\n\n```sh\nlde add lua-sys --git https://github.com/lde-org/lua-sys\n```\n\n## Example\n\n```lua\nlocal lua = require(\"lua-sys\")\n\nlocal state = lua.new()\n\n-- Load compiles code into a Chunk. Use :eval() to run it and get a Value.\nlocal fn = state:load(\"return function(a, b) return a + b end\"):eval()\nlocal result = fn:call(3, 4)\nprint(result:type())  --\u003e \"number\"\nprint(result:value()) --\u003e 7\n\n-- :exec() runs a chunk for side effects, discarding results.\nstate:load(\"answer = 42\"):exec()\nlocal answer = state:load(\"return answer\"):eval()\nprint(answer:value()) --\u003e 42\n\n-- Access the global table\nlocal globals = state:globals()\nglobals:set(\"message\", \"hello from Lua\")\nlocal msg = globals:get(\"message\")\nprint(msg:type())  --\u003e \"string\"\nprint(msg:value()) --\u003e \"hello from Lua\"\n\n-- Pass plain Lua functions as callbacks\nglobals:set(\"greet\", function(name)\n  return \"Hi, \" .. name:value()\nend)\n\nlocal greet = state:load(\"return function(n) return greet(n) end\"):eval()\nprint(greet:call(\"World\"):value()) --\u003e \"Hi, World\"\n\nstate:close()\n```\n\n## Example (Raw)\n\n```lua\nlocal raw = require(\"lua-sys\").raw\n\nlocal L = raw.lnewstate()\nraw.openlibs(L)\n\n-- Compile and run a Lua chunk\nraw.loadstring(L, \"return 2 + 2\")\nraw.pcall(L, 0, 1, 0) -- (state, nargs, nresults, errfunc)\nprint(raw.tonumber(L, 1)) --\u003e 4\n\n-- Push values, manipulate the stack\nraw.pushstring(L, \"hello\")\nraw.pushnumber(L, 42)\nprint(raw.tolstring(L, 1)) --\u003e \"hello\"\nprint(raw.gettop(L))        --\u003e 2\n\n-- Work with tables\nraw.createtable(L, 0, 0)\nraw.pushstring(L, \"value\")\nraw.setfield(L, 1, \"key\")\nraw.getfield(L, 1, \"key\")\nprint(raw.tolstring(L, 2)) --\u003e \"value\"\n\nraw.close(L)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flde-org%2Flua-sys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flde-org%2Flua-sys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flde-org%2Flua-sys/lists"}