{"id":20134708,"url":"https://github.com/approvers/do-lua","last_synced_at":"2025-04-09T17:14:29.934Z","repository":{"id":42569228,"uuid":"227618467","full_name":"approvers/do-lua","owner":"approvers","description":"The Lua binding for JavaScript.","archived":false,"fork":false,"pushed_at":"2024-06-18T17:22:11.000Z","size":728,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T17:14:23.027Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/approvers.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-12T13:52:38.000Z","updated_at":"2024-06-18T17:22:11.000Z","dependencies_parsed_at":"2023-02-08T08:16:14.932Z","dependency_job_id":"8b853d29-be10-4e3f-a745-3b69629b1ed8","html_url":"https://github.com/approvers/do-lua","commit_stats":{"total_commits":83,"total_committers":2,"mean_commits":41.5,"dds":0.07228915662650603,"last_synced_commit":"a1c1da49c29417624b632a1334831d95650705f4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/approvers%2Fdo-lua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/approvers%2Fdo-lua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/approvers%2Fdo-lua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/approvers%2Fdo-lua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/approvers","download_url":"https://codeload.github.com/approvers/do-lua/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248074924,"owners_count":21043490,"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":[],"created_at":"2024-11-13T21:11:13.655Z","updated_at":"2025-04-09T17:14:29.915Z","avatar_url":"https://github.com/approvers.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# do-lua\n\nThe Lua runtime for Node.js.\n\n## Usage\n\n```js\nconst { doFile, doString } = require('do-lua');\n\nconst program = `\nprint(\"Hello, World!\")\n`;\n\ndoString(program).then(() =\u003e {\n  console.log(\"Done doString\");\n})\ndoFile('examples/test1.lua').then(() =\u003e {\n  console.log(\"Done doFile\");\n})\n```\n\nYou cannot use `this` in functions of the passing table on `loadProgram`. Use arrow function instead of that.\n\n```js\nconst { loadProgram } = require('do-lua');\n\nconst state = loadProgram(`\nobj.ox = 50;\nobj.mes(\"Hello, World!\")\n`);\nlet message = '';\nconst table = {\n  ox: 0,\n  mes: (text) =\u003e {\n    message += text; // `this` cannot be used but can capture variables.\n  }\n};\nstate.setTable('obj', table);\n\nstate.run().then((G) =\u003e { // G is global table exclusive \"package\" and \"_G\"\n  console.log(\"ox: \", G.obj.ox); // 50\n  console.log(\"Message: \", message); // Hello, World!\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapprovers%2Fdo-lua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapprovers%2Fdo-lua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapprovers%2Fdo-lua/lists"}