riccardo

2.1.5 • Public • Published

Riccardo

Dependency Injection Container for Node.js

설치하기

npm install riccardo

사용하기

const Riccardo = require('riccardo');
var riccardo = new Riccardo();

// singleton
riccardo
  .set('myStr', 'value')
  .set('myFunc', function () {});

riccardo.get('myStr');
riccardo.get('myFunc');

var injected = riccardo.inject(function (myStr, a, myFunc, b) {});
injected('a', 'b');

var lazyInjected = riccardo.lazy(function (myStr, myFunc, a, myStr2, b, c) {});
riccardo.set('myStr2', 'value2');
lazyInjected('a', 'b', 'c');

var lazyInjected2 = riccardo.$(function (myNewStr) {});
// singleton
riccardo.factory('myNewStr', function (myStr, myStr2) {
  return myStr + myStr2;
});
lazyInjected2();

riccardo.scan('directory', 'optionalNamespace');

Readme

Keywords

none

Package Sidebar

Install

npm i riccardo

Weekly Downloads

1

Version

2.1.5

License

MIT

Unpacked Size

31.1 kB

Total Files

25

Last publish

Collaborators

  • hyeongukryu