All Projects → lorenwest → Node Config

lorenwest / Node Config

Licence: other
Node.js Application Configuration

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
shell
77523 projects
coffeescript
4710 projects

Projects that are alternatives of or similar to Node Config

plaster
Application config settings abstraction layer.
Stars: ✭ 19 (-99.65%)
Mutual labels:  config, settings
mutable
State containers with dirty checking and more
Stars: ✭ 32 (-99.41%)
Mutual labels:  state, properties
configster
Rust library for parsing configuration files
Stars: ✭ 19 (-99.65%)
Mutual labels:  config, settings
Dotfiles
Config for vim sublime awesome xmonad etc.
Stars: ✭ 140 (-97.42%)
Mutual labels:  config, settings
props
config source library for golang, support properties/yaml/ini file、zookeeper\consul\etcd k/v k/props
Stars: ✭ 57 (-98.95%)
Mutual labels:  config, properties
Simple Settings
A simple way to manage your project settings.
Stars: ✭ 165 (-96.96%)
Mutual labels:  config, settings
cfg-rs
A Configuration Library for Rust Applications
Stars: ✭ 18 (-99.67%)
Mutual labels:  config, settings
Qonfig
Config. Defined as a class. Used as an instance. Lazy instantiation. Validation layer. Thread-safe. Support for YAML, TOML, JSON, __END__, ENV. Extremely simple to define. Extremely simple to use.
Stars: ✭ 17 (-99.69%)
Mutual labels:  config, settings
config
Config component, strictly typed
Stars: ✭ 14 (-99.74%)
Mutual labels:  config, settings
transfer
Converts from one encoding to another. Supported formats HCL ⇄ JSON ⇄ YAML⇄TOML⇄XML⇄plist⇄pickle⇄properties ...
Stars: ✭ 70 (-98.71%)
Mutual labels:  config, properties
Dynaconf
Configuration Management for Python ⚙
Stars: ✭ 2,082 (-61.61%)
Mutual labels:  config, settings
goconfig
.gitconfig syntax parser
Stars: ✭ 15 (-99.72%)
Mutual labels:  config, properties
Rime pure
【rime小狼毫\trime同文】手机/PC一站式配置【简约皮肤\拼音搜狗词库\原创trime同文四叶草九宫格拼音方案\四叶草拼音、小鹤双拼、极品五笔、徐码、郑码】 rime配置
Stars: ✭ 73 (-98.65%)
Mutual labels:  config, settings
Konf
A type-safe cascading configuration library for Kotlin/Java/Android, supporting most configuration formats
Stars: ✭ 225 (-95.85%)
Mutual labels:  config, properties
Ins sandstorm
[INS] Config setting for our sandstorm server
Stars: ✭ 61 (-98.88%)
Mutual labels:  config, settings
javaproperties
Python library for reading & writing Java .properties files
Stars: ✭ 20 (-99.63%)
Mutual labels:  config, properties
Universal
Seed project for Angular Universal apps featuring Server-Side Rendering (SSR), Webpack, CLI scaffolding, dev/prod modes, AoT compilation, HMR, SCSS compilation, lazy loading, config, cache, i18n, SEO, and TSLint/codelyzer
Stars: ✭ 669 (-87.66%)
Mutual labels:  config, state
climatecontrol
Python library for loading settings and config data from files and environment variables
Stars: ✭ 20 (-99.63%)
Mutual labels:  config, settings
profig
Powerful configuration management for Scala (JSON, properties, command-line arguments, and environment variables)
Stars: ✭ 25 (-99.54%)
Mutual labels:  config, properties
Laravel Setting
Persistent settings package for Laravel
Stars: ✭ 278 (-94.87%)
Mutual labels:  config, settings

Configure your Node.js Applications

NPM   Build Status   release notes

Introduction

Node-config organizes hierarchical configurations for your app deployments.

It lets you define a set of default parameters, and extend them for different deployment environments (development, qa, staging, production, etc.).

Configurations are stored in configuration files within your application, and can be overridden and extended by environment variables, command line parameters, or external sources.

This gives your application a consistent configuration interface shared among a growing list of npm modules also using node-config.

Project Guidelines

  • Simple - Get started fast
  • Powerful - For multi-node enterprise deployment
  • Flexible - Supporting multiple config file formats
  • Lightweight - Small file and memory footprint
  • Predictable - Well tested foundation for module and app developers

Quick Start

The following examples are in JSON format, but configurations can be in other file formats.

Install in your app directory, and edit the default config file.

$ npm install config
$ mkdir config
$ vi config/default.json
{
  // Customer module configs
  "Customer": {
    "dbConfig": {
      "host": "localhost",
      "port": 5984,
      "dbName": "customers"
    },
    "credit": {
      "initialLimit": 100,
      // Set low for development
      "initialDays": 1
    }
  }
}

Edit config overrides for production deployment:

 $ vi config/production.json
{
  "Customer": {
    "dbConfig": {
      "host": "prod-db-server"
    },
    "credit": {
      "initialDays": 30
    }
  }
}

Use configs in your code:

const config = require('config');
//...
const dbConfig = config.get('Customer.dbConfig');
db.connect(dbConfig, ...);

if (config.has('optionalFeature.detail')) {
  const detail = config.get('optionalFeature.detail');
  //...
}

config.get() will throw an exception for undefined keys to help catch typos and missing values. Use config.has() to test if a configuration value is defined.

Start your app server:

$ export NODE_ENV=production
$ node my-app.js

Running in this configuration, the port and dbName elements of dbConfig will come from the default.json file, and the host element will come from the production.json override file.

Articles

Further Information

If you still don't see what you are looking for, here are some more resources to check:

Contributors

lorenwest markstos iMoses elliotttf jfelege leachiM2k
josx enyo leosuncin arthanzel eheikes th507
Osterjour cunneen nsabovic BadgerBadgerBadgerBadger simon-scherzinger leonardovillela
axelhzf benkroeger fgheorghe IvanVergiliev jpwilliams jaylynch
jberrisch kgoerlitz bertho-zero NguyenMatthieu nitzan-shaked robertrossmann

License

May be freely distributed under the MIT license.

Copyright (c) 2010-2020 Loren West and other contributors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].