@daryl-software/ts-config-loader
JSON files loader & watcher
Installation
pnpm i @daryl-software/ts-config-loader
Usage
type DbConfig = { db: { host: string; port: number, password?: string }[] };
const config = new ConfigLoader([`directory/base.json`, `directory/env-override.json`], { verbose: true });
const dbConfig = config.get<DbConfig>('db');
config.addObserver<DbConfig>('db', (all) => {
// changed
});