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

@travetto/config

Package Overview
Dependencies
Maintainers
1
Versions
297
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@travetto/config

travetto: Config ===

  • 0.0.27
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
129
decreased by-69.65%
Maintainers
1
Weekly downloads
 
Created
Source

travetto: Config

Common functionality for reading configuration from yaml files, and allowing overriding at execution time

  • Process all config information:
    • node_modules/@travetto/*/config/*.yml
    • config/*.yml
    • env/<env>.yml
    • process.env (override only)
  • Depending on which environments are specified, will selectively load env/<env>.yml files
  • Every configuration property can be overridden via environment variables (case-insensitive).
    • Object navigation is separated by underscores
    • e.g. MAIL_TRANSPORT_HOST would override mail.transport.host and specifically transport.host in the mail namespace.

Provides a decorator, @Config("namespace") that allows for classes to automatically bind config information on post construct. The decorator will install a postConstruct method if not already defined. This is a hook that is used by other modules.

@Config('sample')
class SampleConfig {
  private host: string;
  private port: number;
  private creds = {
    user: '',
    password: ''
  };
}

And the corresponding config file

- sample
  host: google.com
  port: 80
  creds:
    user: bob
    password: bobspw

FAQs

Package last updated on 16 May 2018

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