No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
test
.gitignore
.npmignore
.travis.yml
LICENSE
README.md
application-blueprint.js
package.json

README.md

application-blueprint

application-blueprint is a very lightweight dependency injection framework for Node.js applications. It makes it very easy to unit test, due to the very simple constructor injection pattern.

Build Status Coverage Dependencies

NPM

Configuration format

The create(base, configurationFile); function below reads a blueprint configuration file. The format looks something like this:

module.exports =
[
  { external: "http" },
  "./components/handler",
  { path: './components/service', name: "coolService" },
  { path: './components/simpleExecutor', mapbinder: "executors", name: "executor1" },
  { path: './components/advancedExecutor', mapbinder: "executors", name: "executor2" }
]

As you can see, you can use simple strings in the configuration. Simple strings are equivalent to using { path: '...' }.

You can register external modules using the external keyword. application-blueprint will simply require that module and register it in the container.

The name of the modules can be left out. If not specified, it will be derived from other fields. For example, for { path: './components/service' }, it will use service as the name of the module. Everything after the last slash is used, if one exists. For external modules, it will use whatever you enter in the external part, which is usually what you want.