yaml-settings

1.1.0 • Public • Published

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

/yaml-settings/

    Package Sidebar

    Install

    npm i yaml-settings

    Weekly Downloads

    0

    Version

    1.1.0

    License

    MIT

    Last publish

    Collaborators

    • brook