scatter-plugin-config

    0.1.0 • Public • Published

    NPM version Dependency Status

    Synopsis

    Allows the Scatter IoC container to inject configuration parameters. Internally it loads the config module (by default) and invokes a get using the given config parameter.

    Usage

    Setup Scatter to use the plugin

    var Scatter = require('scatter'),
      ScatterPluginConfig = require('scatter-plugin-config');
     
     
    var scatter = new Scatter({
      plugins: [new ScatterPluginConfig()]
    });
     

    Config parameter as dependency

     
    module.export = function(username) {
      return {
        connect: function() {
          //do something with username
        }
      };
    };
     
    module.export.__module = {
      //inject a config parameter as dependency
      args: ["config!db.username"]
    };
     

    Stability

    2 - Unstable

    The API is in the process of settling, but has not yet had sufficient real-world testing to be considered stable.


    Bitdeli Badge

    Keywords

    none

    Install

    npm i scatter-plugin-config

    DownloadsWeekly Downloads

    25

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • mariocasciaro