Bring your node.js modules to life
.("""") (j)(_(_ __(_ ) (n o d e)_ _ _ _ / / / (n) (s)))`)`) ___ )L __ __ / / / n \|/ \|/((,(,' ((_( (( (('(| n \|/ | |
Node water to bring your node.js modules to life.
"Bring" follows an inversion of control pattern similar to Java Spring. It helps you easily build applications from modules which you link together using configuration, not code.
At runtime Bring reads your configuration file(s) and instantiates the modules that are specified. It sets options, calls functions on those modules and can pass refences between them or to your main application. Using bring you can have an application bootstrapped, up and running almost entirely by configuration. This is great if you want to "mix" different varients of your application or run your application with different configurations in different environments.
var bring = require'bring-modules';bringautoconfigure;
Your application is now running!
Bring configuration is a JSON object in the following format.
At the top level there are three sections, require, construct and templates.
config ="require" : required-modules //required. (see Requiring Modules)"construct" : constructors //required. (see Constucting Modules)"templates" : template-constructors //optional. (see Templates)
required-modules ="<module-name>": module-optionsmodule-options ="depends": "<module-name>""real-name": "<module-real-name>"
Effectively this a wrapper for the
require() function with a few extra options:
required-modules - Object. With 1..* properties:
module-options - Object. With 2 properties:
constructors ="< >":
template-constructors ="< >":