1.1.0 • Published 7 years ago

yaml-settings v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

yaml-settings

Build Status Code Climate npm:

Read or write configration in much more easy way in node.js apps

Features

  • Ready or write configration via dot notation.
  • Automatically save to config file when you call set().

Installation

npm install --save yaml-settings

Usage

In config.js

const Settings = require('yaml-settings');

const config = new Settings('.your-app-name.yml', [<config file directiory>]);
config.init({
  git_cmd: 'git'
}); // init with default settings

module.exports = config;

Then read or write your configrations in anywhere of your project

const config = require('./config');
config.set('alias.b', 'blog');  // add config key, and save it automatically
config.get('alias.b');          // read config
config.set('alias.b');          // delete config

More info about the `dot' notation in get and set, see dot2val

Related Projects

License

MIT