1.3.0 • Published 9 years ago

appjector v1.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

Appjector

Appjector is a simple lib that aims to simplify dependencies management and to ease testing for modular node projects

Build Status Coverage Status npm version Dependency Status devDependency Status


This was an experiment about dependencies injection. There are some nice concepts with these "applicative containers", especially when it comes to testing and sharing components between apps but it seems to add unneeded complexity.


Bootstrap an application

the simple way

//index.js

'use strict';

var appjector = require('appjector');

appjector
  .container('./app')
  .run();

File format

Principles:

  • The filename defines the component's name
  • Exports an anonymous function
  • The function arguments define the required dependencies
  • The function returns the component's value
'use strict';

module.exports = function(dep1, dep2, Dep3) {)
	return {} // or Class, [], 'hello', fn ...;
};

Defining containers

Have a look at how appjector.container works here


Add asynchronous start/stop logics

Have a look at how appjector.AppSwitch helper works here


How to test

Have a look at how container.isolate, container.replace, container.keep, and container.without work here


More

  • Full documentation can be seen here
  • Backlog can be seen here

1.3.0

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago