New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

bring-modules

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bring-modules

Bring your node.js modules to life

latest
Source
npmnpm
Version
0.0.10
Version published
Maintainers
1
Created
Source
                                 .("""")                                      (j)
                               (_(_ __(_ )                                 (n o d e)
 _ _ _       _                   / / /                       (n)              (s)
 ))`)`) ___  )L __ __           / / /           n            \|/              \|/
((,(,' ((_( (( (('(|             n             \|/            |                |

Part of the Node Water collection.

  • bring-modules - Bring your node.js modules to life.

So What Does it Do?!

"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.

For example:

var bring = require('bring-modules');
bring.autoconfigure();

Your application is now running!

Installation

Official releases can be obtained from:

  • github.com - the tags section provides links to zip or tar.gz packages.
  • npm - use npm install bring-modules

The lastest developed code may node have not have been released, but can always be found from:

  • github.com - the project homepage provides links to all the source code, branches and issue tracking.

The Config File

Bring configuration is a JSON object in the following format.

Top Level

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)
}

Requiring Modules

required-modules = {
  "<module-name>": module-options,
  ...    
}

module-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-name> - Object. Modules are stored for later use to module-names need to be unique. Unless real-name is also give, module-name is also the string passed to require e.g. require('<module-name>').
  • module-options - Object. With 2 properties:

    • depends - Array. Lists the module-names that should be loaded before this module.
    • real-name - String. If you need to give a module your own name use this option. Make module-name the name you want to use it and real-name is the name you would normall pass to the require() function.

Constucting Modules

constructors = {
  "< >":  ,
  ...    
}

TODO

Templates

template-constructors = {
  "< >":  ,
  ...    
}

TODO

Keywords

water

FAQs

Package last updated on 21 Jan 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts