lpm is a modern package manager and toolkit for Lua, written in Lua.
It includes a LuaJIT runtime for any operating system, a test runner, and the ability to compile your Lua programs into single executables users can run in <1mB. All of this alongside a package manager and package registry to easily share and reuse lua code, properly version locked and isolated to your individual projects.
To get started, read the docs.
- Easy project creation with
lpm newandlpm init - Automatic local package management, avoid conflicting global installs
lpm add --path <package>- Install local dependencies (good for monorepos)lpm add --git <repo>- Install git dependencies (supports monorepos)lpm run- Runs your project's init file and installs dependencieslpm compile- Turn your project into a single executable, easily distributablelpm test- Run project tests with the built-in test framework,lpm-testlpm bundle- Bundle your project into a single lua filelpm x- Execute a project in another location, perfect for CLIs (alias:lpx)lpm tree- View your dependencies at a glancelpm update- Update your dependencies to their latest versionslpm publish- Create a PR to add your package to the registry
| OS | Command |
|---|---|
| Linux | curl -fsSL https://lualpm.com/install | sh |
| Windows | irm https://lualpm.com/install.ps1 | iex |
To upgrade your lpm version, simply run lpm upgrade!
Create a project with dependencies..
lpm new myproject && cd myproject
lpm add hood --git https://github.com/codebycruz/hood
echo "print(require('hood'))" > ./src/init.lua
lpm run
# Output: table: 0x7f53326fd030Or run a repository's code in a single command!
lpx triangle --git https://github.com/codebycruz/hoodI made this to the best of my ability with limited information about LuaRocks and Lux.
If anyone has any corrections, please do submit a pull request.
| lpm | lux | luarocks | |
|---|---|---|---|
| Written in | Lua | Rust | Teal |
| Project format | JSON | TOML/Lua | Lua |
| Add/remove deps | ✓ | ✓ | ❌ |
| Built-in test runner | ✓ (lpm-test) | ✓ (busted) | ❌ |
| Ships with LuaJIT | ✓ | ❌ | ❌ |
| Compile to executable | ✓ | ❌ | ❌ |
| Git deps | ✓ | ✓ | ❌ |
| Registry deps | ✓ (lpm) | ✓ (luarocks) | ✓ (luarocks) |
| Custom Registry | ✓ | ❌ | ✓ |
| Lockfile | ✓ | ✓ | ✓ |
| Luarocks Support | ❌ (#53) | ✓ | ✓ |
| Lua build scripts | build.lua | rockspec | rockspec |