Repository navigation
0.6.0
NnFileKit 0.6.0 Release Notes
NnConfigKit — a new module for type-safe JSON configuration management, built on NnFileKit's existing FileSystem and Directory protocols.
What's New
NnConfigManager<Config: Codable>— generic manager for loading, saving, and updating JSON config files at~/.config/NnConfigList/{projectName}/- Nested config file support — create, append, remove, and delete files within config directory hierarchies
- Fully testable — accepts an injected
FileSystem, works withMockFileSystem/MockDirectoryout of the box - Sendable — safe for Swift 6 strict concurrency
Quick Start
import NnConfigKit
struct AppConfig: Codable {
var theme: String
var maxRetries: Int
}
let manager = NnConfigManager<AppConfig>(projectName: "MyApp")
try manager.saveConfig(AppConfig(theme: "dark", maxRetries: 3))
let config = try manager.loadConfig()Installation
.product(name: "NnConfigKit", package: "NnFileKit")