Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@backstage/config-loader

Package Overview
Dependencies
Maintainers
0
Versions
861
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@backstage/config-loader

Config loading functionality used by Backstage backend, and CLI

  • 0.0.0-nightly-20241209023914
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
134K
decreased by-2.17%
Maintainers
0
Weekly downloads
 
Created

What is @backstage/config-loader?

@backstage/config-loader is a package designed to load and manage configuration files for Backstage applications. It supports various configuration formats and allows for merging and validating configurations, making it easier to manage complex setups.

What are @backstage/config-loader's main functionalities?

Loading Configuration Files

This feature allows you to load configuration files from specified paths. The `loadConfig` function reads the configuration files and merges them into a single configuration object.

const { loadConfig } = require('@backstage/config-loader');

async function load() {
  const config = await loadConfig({
    configRoot: './config',
    configPaths: ['./app-config.yaml'],
  });
  console.log(config.get());
}

load();

Merging Configurations

This feature allows you to merge multiple configuration files. The `loadConfig` function can take multiple paths, and it will merge the configurations in the order they are provided.

const { loadConfig } = require('@backstage/config-loader');

async function load() {
  const config = await loadConfig({
    configRoot: './config',
    configPaths: ['./app-config.yaml', './app-config.local.yaml'],
  });
  console.log(config.get());
}

load();

Validating Configurations

This feature allows you to validate and read specific configuration values. The `ConfigReader` class provides methods to read and validate configuration values.

const { loadConfig } = require('@backstage/config-loader');
const { ConfigReader } = require('@backstage/config');

async function load() {
  const config = await loadConfig({
    configRoot: './config',
    configPaths: ['./app-config.yaml'],
  });
  const configReader = new ConfigReader(config.get());
  const value = configReader.getString('app.title');
  console.log(value);
}

load();

Other packages similar to @backstage/config-loader

Keywords

FAQs

Package last updated on 09 Dec 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc