{"id":16186919,"url":"https://github.com/robloach/scriptpacker","last_synced_at":"2025-03-19T03:30:33.664Z","repository":{"id":57356358,"uuid":"194364602","full_name":"RobLoach/scriptpacker","owner":"RobLoach","description":"Package multiple Wren, Squirrel or ChaiScript files into one, through JavaScript.","archived":false,"fork":false,"pushed_at":"2021-03-30T19:18:31.000Z","size":31,"stargazers_count":5,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-25T12:20:27.550Z","etag":null,"topics":["chaiscript","lua","squirrel","wren"],"latest_commit_sha":null,"homepage":"https://npm.im/scriptpacker","language":"JavaScript","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/RobLoach.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}},"created_at":"2019-06-29T04:37:04.000Z","updated_at":"2024-02-29T05:35:32.000Z","dependencies_parsed_at":"2022-09-26T16:31:52.593Z","dependency_job_id":null,"html_url":"https://github.com/RobLoach/scriptpacker","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fscriptpacker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fscriptpacker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fscriptpacker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fscriptpacker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobLoach","download_url":"https://codeload.github.com/RobLoach/scriptpacker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243963560,"owners_count":20375640,"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":["chaiscript","lua","squirrel","wren"],"created_at":"2024-10-10T07:19:50.452Z","updated_at":"2025-03-19T03:30:33.346Z","avatar_url":"https://github.com/RobLoach.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ScriptPacker\n\nPackage multiple [Lua](https://www.lua.org/), [Wren](http://wren.io), [Squirrel](http://squirrel-lang.org/), Javascript, or [ChaiScript](http://chaiscript.com/) scripts together into one bundle, through JavaScript.\n\n## Features\n\n- [Lua](https://www.lua.org/) `require \"MyModule\"`\n- [Squirrel](http://squirrel-lang.org) `import(\"MyModule\")`\n- [Wren](http://wren.io) `import \"MyModule\"`\n- [Gravity](https://github.com/marcobambini/gravity) `#include \"MyModule.gravity\"`\n- [ChaiScript](http://chaiscript.com) `require(\"MyModule\")`\n- JavaScript `require(\"MyModule\")`\n- Retains dependency tree\n- Relative import paths\n\n## Installation\n\n```\nnpm i -g scriptpacker\n```\n\n## Usage\n\n```\nscriptpacker build [input]\n\nBuild the given file\n\nPositionals:\n  input  The input file to build                         [default: \"index.wren\"]\n\nOptions:\n  --version     Show version number                                    [boolean]\n  --help        Show help                                              [boolean]\n  --output, -o  Where to write the file       [string] [default: \"packed.\u003cext\u003e\"]\n  --minify, -m  Minify the output                     [boolean] [default: false]\n  --prefix, -p  Text to prefix the output                 [string] [default: \"\"]\n```\n\n## Example\n\n1. Create a script file to import, `Unicorn.wren` for example:\n\t``` wren\n\tclass Unicorn {\n\t\tconstruct new() {\n\t\t\tSystem.print(\"Greetings.\")\n\t\t}\n\t\trun() {\n\t\t\tSystem.print(\"Running!\")\n\t\t}\n\t}\n\t```\n\n2. Use `import` to bundle the module:\n\t``` wren\n\timport \"Unicorn\"\n\t// In Squirrel, it would be: import(\"Unicorn\")\n\t// Use the imported class.\n\tvar unicorn = Unicorn.new()\n\tunicorn.run()\n\t```\n\n3. Run the build command\n\t``` bash\n\tscriptpack build index.wren --output=packed.wren\n\t```\n\n4. See the resulting `packed.wren`\n\t``` wren\n\t// Unicorn.wren\n\tclass Unicorn {\n\t\tconstruct new() {\n\t\t\tSystem.print(\"Greetings.\")\n\t\t}\n\t\trun() {\n\t\t\tSystem.print(\"Running!\")\n\t\t}\n\t}\n\t// Game.wren\n\t// import \"Unicorn\"\n\tvar unicorn = Unicorn.new()\n\tunicorn.run()\n\t```\n\n## Documentation\n\nThe following are examples of loading the Unicorn script across the different languages...\n\n### [Lua](https://www.lua.org)\n\n``` javascript\nrequire \"Unicorn\"\n\n// ... or\nrequire(\"Unicorn\")\n```\n\n### [Wren](https://github.com/wren-lang/wren)\n\n``` javascript\nimport \"Unicorn\"\n```\n\n### [Squirrel](http://www.squirrel-lang.org)\n\n``` javascript\nimport(\"Unicorn\")\n```\n\n### [ChaiScript](http://chaiscript.com)\n\n``` javascript\nrequire(\"Unicorn\")\n```\n\n### JavaScript\n\n``` javascript\nrequire(\"Unicorn\")\n```\n\n### [Gravity](https://github.com/marcobambini/gravity)\n\n``` swift\n#include \"Unicorn.gravity\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobloach%2Fscriptpacker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobloach%2Fscriptpacker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobloach%2Fscriptpacker/lists"}