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

@backstage/config

Package Overview
Dependencies
Maintainers
3
Versions
326
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@backstage/config

Config API used by Backstage core, backend, and CLI

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

Version published
Weekly downloads
153K
decreased by-0.11%
Maintainers
3
Weekly downloads
 
Created

What is @backstage/config?

@backstage/config is a configuration management library designed for use with Backstage, a platform for building developer portals. It provides a structured way to manage and access configuration data, supporting features like environment variable substitution, schema validation, and hierarchical configuration.

What are @backstage/config's main functionalities?

Loading Configuration

This feature allows you to load configuration data into a ConfigReader instance, which can then be used to access configuration values using a path-like syntax.

const { ConfigReader } = require('@backstage/config');
const config = new ConfigReader({
  app: {
    title: 'My App',
    port: 3000
  }
});
console.log(config.getString('app.title')); // Outputs: 'My App'

Environment Variable Substitution

This feature allows you to use environment variables within your configuration files, enabling dynamic configuration based on the environment.

const { ConfigReader } = require('@backstage/config');
process.env.APP_PORT = '4000';
const config = new ConfigReader({
  app: {
    port: '${APP_PORT}'
  }
});
console.log(config.getNumber('app.port')); // Outputs: 4000

Schema Validation

This feature allows you to define a schema for your configuration and validate the configuration data against this schema, ensuring that the configuration is structured and typed correctly.

const { ConfigReader, ConfigSchema } = require('@backstage/config');
const schema = ConfigSchema.object({
  app: ConfigSchema.object({
    title: ConfigSchema.string(),
    port: ConfigSchema.number()
  })
});
const config = new ConfigReader({
  app: {
    title: 'My App',
    port: 3000
  }
});
schema.validate(config); // Validates the configuration against the schema

Other packages similar to @backstage/config

Keywords

FAQs

Package last updated on 12 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