Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benjamin-dobell/luabundler
CLI tool for bundling several Lua files into a single file.
https://github.com/benjamin-dobell/luabundler
bundler lua modules
Last synced: 2 months ago
JSON representation
CLI tool for bundling several Lua files into a single file.
- Host: GitHub
- URL: https://github.com/benjamin-dobell/luabundler
- Owner: Benjamin-Dobell
- License: mit
- Created: 2020-01-14T18:46:34.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-12T22:47:28.000Z (almost 3 years ago)
- Last Synced: 2024-05-01T18:52:16.889Z (9 months ago)
- Topics: bundler, lua, modules
- Language: TypeScript
- Homepage:
- Size: 292 KB
- Stars: 27
- Watchers: 3
- Forks: 10
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
luabundler
==========CLI tool for bundling several Lua files into a single file.
If you're looking for an API, see [luabundle](https://github.com/Benjamin-Dobell/luabundle)
[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
[![Version](https://img.shields.io/npm/v/luabundler.svg)](https://npmjs.org/package/luabundler)
[![Downloads/week](https://img.shields.io/npm/dw/luabundler.svg)](https://npmjs.org/package/luabundler)
[![License](https://img.shields.io/npm/l/luabundler.svg)](https://github.com/Benjamin-Dobell/luabundler/blob/master/package.json)* [Installation](#installation)
* [Usage](#usage)# Installation
```bash
npm install -g luabundler
```# Usage
## bundle
The `bundle` command takes an input Lua file, and recursively collects all the `require()`d modules and bundles them into a single output bundle.
```bash
luabundler bundle input.lua -p "/path/to/lua/?.lua" -o bundle.lua
```If you don't specify an output file (`-o`), the resultant bundle will be printed to your terminal.
### Search Paths (`-p`)
In order to know where to look for required files, you must provide one or more [search path patterns](https://www.lua.org/pil/8.1.html).
In addition to allowing you to add directories to search within, the pattern format allows you to configure supported file extensions as well.
For example, it's fairly common practice for Lua scripts written for Tabletop Simulator to use the `.ttslua` extension:
```bash
luabundler bundle input.lua -p "/path/to/lua/?.lua" -p "/path/to/mod/?.ttslua" -o bundle.lua
```### Additional Options
Additional bundle options are described with:
```bash
luabundler bundle --help
```## unbundle
The `unbundle` command takes an input bundle, and splits it up into its original modules.
```bash
luabundler unbundle bundle.lua -o original_input.lua -m modules/
```You may omit the `-m` option in order to simply output the root module and ignore all its `require()`'d dependencies i.e. if you already have them on disk.
### Additional Options
Additional unbundle options are described with:
```bash
luabundler unbundle --help
```