Socket
Socket
Sign inDemoInstall

@boost/config

Package Overview
Dependencies
56
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @boost/config

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


Version published
Weekly downloads
19K
decreased by-13.95%
Maintainers
1
Install size
3.44 MB
Created
Weekly downloads
 

Readme

Source

Configuration - Boost

build status npm version

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

  • https://boostlib.dev/docs/config
  • https://boostlib.dev/api/config

Keywords

FAQs

Last updated on 01 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc