Mods is a set of pure Lua modules for daily development. Minimal dependencies, predictable APIs, and support for Lua 5.1, 5.2, 5.3, 5.4, and LuaJIT.
This project is inspired by Penlight (pl).
If this project helps you, consider starring the repo ⭐.
Guides, module overviews, and examples live in the docs.
luarocks install mods-
Unix (🐧 Linux / 🍎 macOS):
git clone https://github.com/luamod/mods.git cd mods mkdir -p /usr/local/share/lua/5.x/ cp -r src/mods /usr/local/share/lua/5.x/ -
🪟 Windows:
Copy all files from
src/mods/toC:\Program Files\Lua\5.x\lua\mods\.
Important
Replace 5.x with your Lua version (for example, 5.4).
| Module | Description |
|---|---|
is |
Type predicates for Lua values and filesystem path kinds. |
List |
Python-style list helpers for mapping, filtering, and slicing. |
operator |
Operator helpers as functions. |
Set |
Set operations and helpers for unique values. |
str |
String utility helpers modeled after Python's str. |
stringcase |
String case conversion helpers. |
tbl |
Utility functions for plain Lua tables. |
template |
Simple template rendering with value replacement. |
utils |
Common utility helpers. |
validate |
Validation helpers for Lua values. |
Note
We are still working on adding new modules and improving the docs.
Thanks to these Lua ecosystem projects: