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

comet-config

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

comet-config

configuration manager

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

comet-config

Build Status npm NSP Status Codacy Badge

Roles

Use a namespace to join environment variables with configuration file and expose a configuration object.

Engine

Any configuration property can be set in environement variable or config file, an environment overrride all files. A environment property is translate from NAMESPACE_MY_VAR to myVar in Configuration object

Utils

You can add additional path to look for config files. the symbol you must provide is extraConfigPaths, it's an array of string.

Config file example

module.exports = { 
  key: 'value',
  test: true, 
  ab: 'test' 
}

Usage

process.env['TEMOC_ENVIRONEMENT_PROPERTY'] = 'property-value'

import { Inject, Injectable, bootstrap } from 'comet-ioc'
import { Configuration, namespace } from "comet-config";

@Injectable()
export class App {
  constructor(@Inject(Configuration) public conf: Configuration) { }
}

app = bootstrap(App, {
  declarations: [
    Configuration
  ],
  constants: [{
    provide: namespace,
    useValue: 'temoc'
  }]
})

console.log( app.conf.props.environementProperty ) // display: property-value

FAQs

Package last updated on 20 Mar 2017

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