1.1.1 • Published 3 years ago

@cnwangjie/conf v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

config.js

Build Status Coverage Status npm.io npm.io

Lightweight Node.js configuration with enough feature.

Installation

yarn add @cnwangjie/conf

Usage

const conf = require('@cnwangjie/conf')

// load config file in bootstrap
conf().load('config.json')
// you can use absolute path or path relative with current path

// besides, you can load any type file of JS, YAML, TOML, ENV and you just need
// install corresponding module

// then you can get the config in every file by require config.js
conf('server.port')
conf().get('server.port')
conf.server.port
// you can use any type of style above

// even you can set separator you like by following way
conf().separator = ':'
conf('server:port')

You need to install corresponding module if you want to use other suffix config file.

suffixmodule
.ymljs-yaml
.yamljs-yaml
.envdotenv
.tomltoml
1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

6 years ago