https://github.com/uriid1/lua-ini
INI file parser
https://github.com/uriid1/lua-ini
ini ini-parser lua luajit
Last synced: 1 day ago
JSON representation
INI file parser
- Host: GitHub
- URL: https://github.com/uriid1/lua-ini
- Owner: uriid1
- License: agpl-3.0
- Created: 2022-06-07T19:46:14.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-11-20T07:41:09.000Z (8 months ago)
- Last Synced: 2025-11-20T09:26:31.289Z (8 months ago)
- Topics: ini, ini-parser, lua, luajit
- Language: Lua
- Homepage:
- Size: 25.4 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lua-ini
Support for load and saving ini files.
---
> [!warning]
> There is no support for load and save comments. Because it doesn't make sense.
# Format
```ini
; One line comment
# Unix style comment
; Global var
test = "Hello, World!"
__version = 1.1
# Environment variable
lang = ${LANG}
user = ${USER}
; Comment
[section_name]
speed = 100 ; Game speed
gravity = 0.1 # Game gravity
[types]
var_int = 123
var_float = 1.23
var_bool = true
var_char = 'A'
var_string = "Awesome ini!"
var_arr[] = 1, 2, 3, 4, 5
var_arr_fruits[] = apple, banana, orange
var_arr_mutate[] = 1, banana, 2, orange
```
# Example
```lua
local ini = require 'ini'
local conf = ini.parse 'test/conf_test.ini'
-- Test
print(conf.__verion)
print(conf.section_name.speed)
print(conf.section_name.gravity)
```