@boost/config
    TypeScript icon, indicating that this package has built-in type declarations

    3.0.1 • Public • Published

    Configuration - Boost

    Build Status npm version npm deps

    Powerful convention based finder, loader, and manager of both configuration and ignore files.

    import { Blueprint, Schemas } from '@boost/common';
    import { Configuration } from '@boost/config';
    
    interface ConfigFile {
    	debug: boolean;
    	sourceMaps: boolean;
    }
    
    class ConfigManager extends Configuration<ConfigFile> {
    	blueprint({ bool }: Schemas): Blueprint<ConfigFile> {
    		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');

    Features

    • Loads root configs (.config/<name>.js) and branch configs (.<name>.js).
    • Loads ignore files (.<name>ignore).
    • Supports multiple config types: js, 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.

    Installation

    yarn add @boost/config
    

    Documentation

    Install

    npm i @boost/config

    DownloadsWeekly Downloads

    2,188

    Version

    3.0.1

    License

    MIT

    Unpacked Size

    139 kB

    Total Files

    107

    Last publish

    Collaborators

    • milesj