All Projects → nswbmw → Config Lite

nswbmw / Config Lite

A super simple & flexible & useful config module.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Config Lite

cfg-rs
A Configuration Library for Rust Applications
Stars: ✭ 18 (-76.92%)
Mutual labels:  config, yaml, toml, configuration
Konf
A type-safe cascading configuration library for Kotlin/Java/Android, supporting most configuration formats
Stars: ✭ 225 (+188.46%)
Mutual labels:  config, yaml, toml, configuration
climatecontrol
Python library for loading settings and config data from files and environment variables
Stars: ✭ 20 (-74.36%)
Mutual labels:  config, yaml, toml, configuration
Dasel
Query, update and convert data structures from the command line. Comparable to jq/yq but supports JSON, TOML, YAML, XML and CSV with zero runtime dependencies.
Stars: ✭ 759 (+873.08%)
Mutual labels:  config, yaml, toml, configuration
Koanf
Light weight, extensible configuration management library for Go. Built in support for JSON, TOML, YAML, env, command line, file, S3 etc. Alternative to viper.
Stars: ✭ 450 (+476.92%)
Mutual labels:  config, yaml, toml, configuration
parse it
A python library for parsing multiple types of config files, envvars & command line arguments that takes the headache out of setting app configurations.
Stars: ✭ 86 (+10.26%)
Mutual labels:  config, yaml, toml, configuration
Simple Settings
A simple way to manage your project settings.
Stars: ✭ 165 (+111.54%)
Mutual labels:  config, yaml, toml, configuration
Mconfig
MCONFIG is a lightweight Golang library for integrating configs files like (json, yml, toml) and environment variables into one config struct.
Stars: ✭ 28 (-64.1%)
Mutual labels:  config, yaml, toml
transfer
Converts from one encoding to another. Supported formats HCL ⇄ JSON ⇄ YAML⇄TOML⇄XML⇄plist⇄pickle⇄properties ...
Stars: ✭ 70 (-10.26%)
Mutual labels:  config, yaml, toml
goodconf
Transparently load variables from environment or JSON/YAML file.
Stars: ✭ 80 (+2.56%)
Mutual labels:  config, yaml, configuration
Config
📝 Go config manage(load,get,set). support JSON, YAML, TOML, INI, HCL, ENV and Flags. Multi file load, data override merge, parse ENV var. Go应用配置加载管理,支持多种格式,多文件加载,远程文件加载,支持数据合并,解析环境变量名
Stars: ✭ 225 (+188.46%)
Mutual labels:  config, yaml, toml
tomlj
A Java parser for Tom's Obvious, Minimal Language (TOML).
Stars: ✭ 72 (-7.69%)
Mutual labels:  config, toml, configuration
yaask
Make your yaml configurable with interactive configurations!
Stars: ✭ 15 (-80.77%)
Mutual labels:  config, yaml, configuration
go-config
Configuration file loader for Go
Stars: ✭ 27 (-65.38%)
Mutual labels:  yaml, toml, configuration
paerser
No description or website provided.
Stars: ✭ 38 (-51.28%)
Mutual labels:  yaml, toml, configuration
Hiyapyco
HiYaPyCo - A Hierarchical Yaml Python Config
Stars: ✭ 58 (-25.64%)
Mutual labels:  config, yaml, configuration
Dynaconf
Configuration Management for Python ⚙
Stars: ✭ 2,082 (+2569.23%)
Mutual labels:  config, configuration, yaml
Config Rs
⚙️ Layered configuration system for Rust applications (with strong support for 12-factor applications).
Stars: ✭ 915 (+1073.08%)
Mutual labels:  config, toml, configuration
Hoplite
A boilerplate-free library for loading configuration files as data classes in Kotlin
Stars: ✭ 322 (+312.82%)
Mutual labels:  config, yaml, configuration
Strictyaml
Type-safe YAML parser and validator.
Stars: ✭ 836 (+971.79%)
Mutual labels:  config, yaml, configuration

config-lite

A super simple & flexible & intuitive config module, support yaml & toml.

Install

$ npm i config-lite --save

Migration

In v1:

const config = require('config-lite');

In v2, you should specify config_basedir directory for bubbling find config file.

const config = require('config-lite')(__dirname);

Usage

const config = require('config-lite')(__dirname);

or:

const config = require('config-lite')({
  filename: 'test',
  config_basedir: __dirname,
  config_dir: 'config'
});

Options

  • filename: config file name, default: default, support: ['.js', '.json', '.node', '.yaml', '.yml', '.toml'].
  • config_basedir: directory for begining bubbling find config directory.
  • config_dir: config directory name, default: config.
  • config: default config object that overwrite config file.

Priority

environment option > custom option > default option

For example:

$ NODE_ENV=test NODE_CONFIG='{"port":3000}' node app.js --port=3001

loading order:

--port=3001 > NODE_CONFIG='{"port":3000}' > opt.config > test config file > default config file

Environment Variables

  • NODE_ENV -> filename
  • CONFIG_BASEDIR || NODE_CONFIG_BASEDIR -> config_dirname
  • CONFIG_DIR || NODE_CONFIG_DIR -> config_dir
  • CONFIG || NODE_CONFIG -> config

Test

$ npm test

License

MIT

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].