config-reader
Configuration file parser for PascalAI. Supports INI, JSON, and YAML formats. Access typed values, nested keys, and lists.
Install
ppm install config-reader
Usage Example
uses config_reader;
// Load config from file (auto-detects format)
var cfg := LoadConfig('app.ini');
// Access typed values
var host := Get(cfg, 'server.host'); // String
var port := GetInt(cfg, 'server.port'); // 8080
var debug := GetBool(cfg, 'app.debug'); // False
var origins := GetList(cfg, 'cors.origins'); // ['https://app.com']
// Check key existence
if HasKey(cfg, 'database.password') then
var pw := Get(cfg, 'database.password');
// Load from JSON or YAML the same way
var cfg2 := LoadConfig('config.yaml');
Features
Load INI, JSON, and YAML configuration files
Dot-notation key paths for nested values
Typed accessors: Get (string), GetInt, GetFloat, GetBool
GetList: retrieve a list of values
HasKey: safely check for key existence before access
Reload: hot-reload configuration at runtime