serviser-config

3.0.0 • Public • Published

Build Status

Configuration plugin for serviser
Loads an application config file from a fs path which defaults to <project_root>/config/config.js.
The config file can also be in json format given that you provide serviser with custom file path:

project-root> ./node_modules/.bin/serviser run --config ./config/config.json

Usage examples:

  • let serviser load its configuration from default fs path
    const Service = require('serviser');
    const Config = require('serviser-config');

    const service = new Service(Config);
  • provide serviser with in-memory config object
    const Service = require('serviser');
    const Config = require('serviser-config');


    const config = Config.createMemoryProvider({
        //...config content
    });

    const service = new Service(config);
  • set config value
    config.set("path:to:nested:option", value);
  • get config value
    var value = config.get("path:to:nested:option");
    var value = config.getOrFail("path:to:nested:option"); //throws if value === undefined

Readme

Keywords

none

Package Sidebar

Install

npm i serviser-config

Weekly Downloads

1

Version

3.0.0

License

GPL-3.0

Unpacked Size

44.9 kB

Total Files

7

Last publish

Collaborators

  • fogine