Powerful convention based finder, loader, and manager of both configuration and ignore files.
npm install @boost/configPowerful convention based finder, loader, and manager of both configuration and ignore files.
``ts
import { Blueprint, Schemas } from '@boost/common';
import { Configuration } from '@boost/config';
interface ConfigFile {
debug: boolean;
sourceMaps: boolean;
}
class ConfigManager extends Configuration
blueprint({ bool }: Schemas): Blueprint
return {
debug: bool(),
sourceMaps: bool(),
};
}
}
const configManager = new ConfigManager('boost');
// Load .config/boost.js, boost.production.json, .boost.yaml, etc
const { config } = await configManager.loadConfigFromRoot('.');
// Load .boostignore files`
const ignore = await configManager.loadIgnoreFromBranchToRoot('./some/deep/path');
- Loads root configs (.config/) and branch configs (.)..
- Loads ignore files ().js
- Supports multiple config types: , cjs, mjs, json, yaml
- Supports environment and root-level based overrides.
- Supports extending from other config files.
- Finds files within each branch folder while traversing up the tree.
- Caches finder results for increased efficiency.
- Custom key-value setting processors.
```
yarn add @boost/config
- https://boostlib.dev/docs/config
- https://boostlib.dev/api/config