RAZI Library


Reusable Architecture & Zero-friction Infrastructure Raziphel's shared foundation for Factorio 2.1 mods. RAZI Library provides dependable prototype editing, recipe and technology helpers, layered icons, settings utilities, validation tools, and runtime event orchestration in one lightweight dependency.

Internal
10 days ago
2.1
52
Owner:
Raziphel
Source:
https://github.com/Raziphel/RaziLib
Homepage:
https://discord.gg/G3X7gpCkf9
License:
MIT
Created:
10 days ago
Latest Version:
1.0.0 (10 days ago)
Factorio version:
2.1
Downloaded by:
52 users

RAZI Library

Reusable Architecture & Zero-friction Infrastructure

RAZI Library is Raziphel's lightweight shared foundation for Factorio 2.1 mods. It gathers dependable prototype editing, recipe and technology utilities, icon composition, validation, settings helpers, and runtime orchestration into one clean dependency.

RAZI makes no gameplay changes by itself. It stays passive until another mod explicitly uses one of its modules.


Why RAZI?

Factorio mods often repeat the same fragile plumbing: searching prototypes, safely changing recipes, managing technology unlocks, layering icons, registering events, and validating compatibility. RAZI provides those building blocks once, with predictable behavior and ordinary Factorio prototype tables.

  • Safe prototype editing with strict and optional lookups
  • Recipe helpers for ingredients, products, categories, quality, recycling, and technology unlocks
  • Technology tools for science packs, prerequisites, costs, effects, and infinite research
  • Item, entity, and module wrappers for common prototype operations
  • Layered icon composition with reusable badges and deterministic layouts
  • Settings and locale utilities for cleaner configuration code
  • Validation helpers that catch missing prototypes, ingredients, unlocks, and duplicate definitions
  • Runtime orchestration for events, persistent storage, and remote interfaces
  • Native Factorio 2.1 support, including multi-category recipes and current quality behavior

Built to stay out of the way

RAZI is deliberately modular. Consumer mods load only the pieces they need, keep ownership of their runtime event registries, and continue working with native Factorio data structures. There is no hidden global recipe target, automatic gameplay patching, or shared runtime state between unrelated mods.

It is suitable for small compatibility mods, focused content packs, and large overhauls such as FluxWorks.


Adding RAZI as a dependency

Add the following entry to your mod's info.json dependencies:

"razi_lib >= 1.0.0"

Then import only the module you need:

local Recipe = require("__razi_lib__/lib/recipe")
local Technology = require("__razi_lib__/lib/technology")

Recipe.get("iron-gear-wheel")
  :upsert_ingredient({ type = "item", name = "steel-plate", amount = 1 })
  :set_energy(1)

Technology.get("automation")
  :add_prerequisite("steel-processing")
  :unlock("my-recipe")

Compatibility philosophy

  • Factorio 2.1 native
  • No Space Age dependency
  • Passive unless called by a consumer
  • Snake-case API with focused compatibility aliases
  • Designed for deterministic, repeatable data-stage edits
  • Pure-Lua regression tests plus real Factorio prototype validation

RAZI is primarily a library for mod developers. Players should install it when another enabled mod lists it as a dependency.