{"id":16645632,"url":"https://github.com/cppcxy/luamodule","last_synced_at":"2025-03-12T08:23:19.573Z","repository":{"id":132588967,"uuid":"204430814","full_name":"CppCXY/luaModule","owner":"CppCXY","description":"lua module development syntax","archived":false,"fork":false,"pushed_at":"2019-08-26T08:28:44.000Z","size":3,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-18T20:07:54.098Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/CppCXY.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}},"created_at":"2019-08-26T08:27:25.000Z","updated_at":"2019-09-05T08:31:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"e9aedbe2-99f8-4224-bfc0-71cf841eb517","html_url":"https://github.com/CppCXY/luaModule","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CppCXY%2FluaModule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CppCXY%2FluaModule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CppCXY%2FluaModule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CppCXY%2FluaModule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CppCXY","download_url":"https://codeload.github.com/CppCXY/luaModule/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243181155,"owners_count":20249420,"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-10-12T08:24:36.772Z","updated_at":"2025-03-12T08:23:19.567Z","avatar_url":"https://github.com/CppCXY.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"## LuaImport\n\n# 引入\n\n    这是一个单文件的库，只需要在可搜索目录下require \"luaImport\"\n\n# 测试\n\n    测试用例不能单独执行，需要用vscode 打开luaImport所在文件夹为工作区，然后执行mainTest\n\n# 使用\n\n    想要使用import 必须在当前文件的开始写上 _ENV=module \"当前模块的，从可搜索的根目录开始下来的路径\" 而且只支持 \"aaaa.bbbb.cccc\" 这样的方式\n\n    import 语法：\n    import \"*\" :from \"xxxxx\"\n    从模块xxx导出所有可导出对象，到当前模块\n\n    import \"*\" :as \"alias\" :from \"xxxxx\"\n    从xxxx导入所有可导入对象到一个 alias 变量中\n\n    import {\"a\",\"b\"} :from \"xxxx\"\n    从xxxx导入 a和b两个对象\n\n    import {\"a\",\"b\"} as \"c\" :from \"xxxxx\"\n    从xxxx导入a,b到表 c中\n\n    from语法：\n    from \"xxxxx\"中 ，xxxx应该是从可搜索的根目录开始的且只支持 dot的方式\n    也支持相对路径，相对路径的语法开头必须是 \".\" 比如同目录下的 test\n    import \"*\" :from \".test\"\n    \".\"代表当前目录\n    \"..\"代表上级目录\n    \"...\"代表上上级目录以此类推\n\n    但是不允许层级大于可搜索的根目录，这会出错的\n\n    export语法：\n    export主要是用于 import\"*\"的形式，当使用这种形式的时候只会导入export指定过的变量\n    例子\n    --file a.lua\n    export \"aaaa\"\n\n    --file b.lua\n    import \"*\" :from \".a\"\n    print(aaaa)\n\n    可以访问aaaa\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcppcxy%2Fluamodule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcppcxy%2Fluamodule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcppcxy%2Fluamodule/lists"}