The Factorio Library is a set of high-quality, commonly-used utilities for creating Factorio mods.
Download the latest release from the
mod portal unzip it, and put it in your
mods directory. You can access libraries provided by flib with
require("__flib__/position"), etc.
Add the flib directory to your language server's library. We recommend installing the Factorio modding toolkit and setting it up with the Sumneko Lua language server to get cross-mod autocomplete and type checking.
You can view the legacy online documentation here. Please note that this documentation is out-of-date, and will be replaced with a new site in the future.
Please use the GitHub repository for questions, bug reports, or pull requests.