yaml-settings
v1.1.0
Published
Read or write your configration in much more easy way in your client apps
Downloads
20
Maintainers
Readme
yaml-settings
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
- yangg / dot2val Set or get a value within a deeply nested object using `dot' notation
- yangg / git-shortcut
License
MIT