Package Exports
- yaml-settings
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (yaml-settings) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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