{"id":21377343,"url":"https://github.com/zeyu-li/lua-runner","last_synced_at":"2025-04-15T16:50:53.743Z","repository":{"id":53491606,"uuid":"352169254","full_name":"Zeyu-Li/lua-runner","owner":"Zeyu-Li","description":"A NPM package to run Lua 🌠 with over 2.5k Downloads!","archived":false,"fork":false,"pushed_at":"2023-01-16T19:23:40.000Z","size":162,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T03:54:55.175Z","etag":null,"topics":["lua","lua-runner","npm","npm-module","npm-package","typescript","webassembly"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/lua-runner","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zeyu-Li.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"Zeyu-Li"}},"created_at":"2021-03-27T20:21:46.000Z","updated_at":"2024-02-26T10:45:44.000Z","dependencies_parsed_at":"2023-02-10T05:40:21.174Z","dependency_job_id":null,"html_url":"https://github.com/Zeyu-Li/lua-runner","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zeyu-Li%2Flua-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zeyu-Li%2Flua-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zeyu-Li%2Flua-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zeyu-Li%2Flua-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zeyu-Li","download_url":"https://codeload.github.com/Zeyu-Li/lua-runner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249113095,"owners_count":21214829,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-runner","npm","npm-module","npm-package","typescript","webassembly"],"created_at":"2024-11-22T09:20:15.637Z","updated_at":"2025-04-15T16:50:53.718Z","avatar_url":"https://github.com/Zeyu-Li.png","language":"TypeScript","readme":"# Lua Runner\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![npm version](https://badge.fury.io/js/lua-runner.svg)](https://badge.fury.io/js/lua-runner) ![download count badge](https://img.shields.io/npm/dt/lua-runner.svg) \n\nA node module that runs Lua code with the power of webassembly! \n\n\n\n## About\n\nRun your Lua code right inside of JavaScript or TypeScript with this module. Made from [wasm_lua](https://github.com/Dreagonmon/wasm_lua)\n\n- [x] Lua 5.4.0\n- [x] TypeScript support\n- [x] 0 dependencies\n- [x] Tests\n- [ ] Browser support\n\n\n\n## Installation\n\nTo install do\n\n`npm i lua-runner --save`\n\n\u003c!-- Build (to include wasm) `` --\u003e\n\n\n\n## Usage\n\nTo use the module\n\n```js\n// import the package\nimport {run_lua} from \"lua-runner\"\n\n// define the lua code\nlet testLuaCode = `    \nfunction hello_lua()\n    print(\"Hello World!\")\n    return \"A\"\nend\nreturn hello_lua()\n`\n\n// run the code with the run_lua function and use then to catch the response\nrun_lua(testLuaCode).then(res=\u003e {\n    console.log(res)\n})\n```\n\nor without ES6 syntax as\n\n```js\nlet { run_lua } = require(\"lua-runner\");\n\nlet testLuaCode = `    \nfunction hello_lua()\n    print(\"Hello World!\")\n    return \"A\"\nend\nreturn hello_lua()\n`;\n\nrun_lua(testLuaCode).then(function (res) {\n    console.log(res);\n});\n```\n\n\n\nlua runner also has a function that returns a response object in the form of the following\n\n```tsx\ninterface response {\n    return?: string\n    exit_code?: string\n}\n```\n\n This function call is `run_lua_res` instead of run_lua\n\n```js\nlet { run_lua_res } = require(\"lua-runner\");\n\nlet testLuaCode = `    \nfunction hello_lua()\n    print(\"Hello World!\")\n    return \"A\"\nend\nreturn hello_lua()\n`;\n\nrun_lua_res(testLuaCode).then(function (res) {\n    console.log(res);\n});\n```\n\n\n\n## Author\n\n* [Zeyu Li](https://github.com/Zeyu-Li)\n\n## License\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://www.lua.org/license.html) \n\nLicense under MIT, check out Lua at [lua.org](https://www.lua.org/) \n","funding_links":["https://github.com/sponsors/Zeyu-Li"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeyu-li%2Flua-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeyu-li%2Flua-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeyu-li%2Flua-runner/lists"}