JSPM

yaml-settings

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q39153F
  • License MIT

Read or write your configration in much more easy way in your client apps

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

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

License

MIT