A next-generation FiveM Script Bridge & Module Manager designed to be incredibly fast, clean, and bloat-free.
Unlike traditional monolithic libraries that force every script to load hundreds of unused functions into memory, LTBridge acts as a smart build tool. It lets you maintain a central repository of your favorite utilities (like Inventory, Framework, Notify) and compiles only the exact code you actually use right into your FiveM resource.
By eliminating slow cross-resource exports and memory bloat, LTBridge helps you build highly independent, lightning-fast scripts with a perfect development experience.
- AOT Compilation: Our Ahead-of-Time compiler bundles everything in under ~200 milliseconds, meaning zero waiting.
- Instant Intellisense: Generates an
api.luastub file automatically. You get full autocomplete for everything as you type (LT.Inventory.AddItem). - Smart Dependencies: If a module needs another module, LTBridge automatically brings it in. No more missing functions.
- Live Watcher: Just run
ltbridge build -wand start coding. It detects what you type, bundles the necessary modules instantly, and updates yourfxmanifest.luaon the fly.
Install the CLI tool globally using npm:
npm install -g @laot/bridgeOr run it directly via npx:
npx @laot/bridge [command]-
Initialize your project:
ltbridge init
Follow the quick prompts to set up your preferences.
-
Start the Watcher:
ltbridge build -w
The watcher will run silently in the background and do all the heavy lifting.
-
Just Code: Use it in your script immediately. Everything else is automatic.
local name, lastname = LT.Framework.GetPlayerName()
When you run init, LTBridge creates a simple JSON config.
| Setting | Default | Description |
|---|---|---|
buildAsBundle |
true |
Combine everything into 3 clean files (shared, client, server). Set to false if you want a separate file for each module. |
debug |
false |
Turn this on if you want to see internal debug prints from the modules. |
minify |
true |
Enables code optimization and global variable randomization for maximum performance. |
modules |
[] |
List of installed modules. The tool manages this automatically! |
| Command | Alias | Description |
|---|---|---|
ltbridge |
- | Interactive Menu: Manage your modules visually. |
ltbridge init |
- | Set up LTBridge in a new project. |
ltbridge build |
sync |
Build the project manually (use -w for live auto-build). |
ltbridge add <name> |
- | Add a specific module manually (e.g., Target/*). |
ltbridge remove <name> |
- | Remove a module. |
ltbridge why <name> |
explain |
See exactly why a module was automatically included. |
ltbridge list |
- | View installed and available modules. |
ltbridge prune |
- | Clean up unused modules from your code. |
Got a cool function or utility? We'd love to have it! The system is designed so anyone can easily add new modules without touching complex configs.
- Fork the repository.
- Create a folder in
modules/(e.g.,modules/@MyCategory/MyFunction). - Write your code:
- Put your code in
client.lua,server.lua, orshared.lua. - Write standard EmmyLua comments (
--- @param,--- @return) for intellisense.
- Put your code in
- Submit a Pull Request: We will review and merge it.
If you are developing modules, you can use special comments to tell the compiler what to do. The compiler reads these, applies them, and then completely deletes the comments from the final build.
--- @ltbridge export: CustomName- Change the exported name of the function.--- @ltbridge alias: AnotherName- Create an alternative name for the same function.--- @ltbridge global- Expose the function directly to the rootLTobject (e.g.,LT.SetResource).--- @ltbridge internal- Marks the module as a "Ghost Module". It runs silently in the background when needed, but doesn't show up in the API or menus.
A huge thanks to the community_bridge project for the inspiration behind some core concepts, and luamin.js for the minification engine.
💡 Tip: To stop your IDE from trying to read the bundled output files (which can cause duplicate intellisense warnings), add this to your VSCode settings (
.vscode/settings.json):"Lua.workspace.ignoreDir": ["**/ltbridge/modules/**"]