@daryl-software/ts-config-loader
v2.2.1-alpha.1
Published
[![npm version](https://badge.fury.io/js/@daryl-software%2Fts-config-loader.svg)](https://badge.fury.io/js/@daryl-software%2Fts-config-loader)
Downloads
30
Readme
@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
});