Giter VIP home page Giter VIP logo

medseek-config's Introduction

NOTE: master branch is preserved for legacy use. All new development, and any code published to npm, should be done under the public branch.

medseek-config

A common configuration module for use within the MEDSEEK API and UI node projects.

about

medseek-config is a lightweight wrapper on top of the https://github.com/flatiron/nconf module, which abstracts access to various configuration stores. Configuration data may come from files, machine environment variables, or the node command line.

usage

  • require the module
var config = require('medseek-config');
  • get a config value
var foo = config.get('foo');

// nested property access
var bar = config.get('foo.bar');

config stores

medseek-config supports 3 types of configuration storage:

  • files - JSON or JS files, located in the root config directory
  • ENV variables - machine environment variables
  • CMD params - command line parameters, passed to node

config files

Config files must be placed in the root config directory. Files should match for format *.config.js or *.config.json in order to be included. Additionally, files matching *.config.local.js or *.config.local.json are also parsed. Local files take precedence over non-local files. Normally a repo should ignore config/*.local.*, allowing developers to override properties as needed, without committing those changes to the repository.

environment variables

Machine environment variables are included in the available configuration data. This is the same set of data normally provided by node under process.env. Note that environment variables take the lowest priority.

command line parameters

Config data may also be set directly from the command line, when starting node. To set a parameter value, prefix it with two dashes, and place an equals sign between the value. For example: --value='hello world' Note that command line parameters take the highest priority.

medseek-config's People

Contributors

poseyj avatar krisburtoft avatar 3choboomer avatar

Watchers

Dennis Calvert avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.