Loads local and remote dependencies in Recart's dependency injection system


7.6.13 years ago3 years agoMinified + gzip package size for @ghostmonitor/recart-di-loader in KB


Greenkeeper badge

  • Loads dependency injectable modules from /services directory
  • A module must return with a constructor that has a dependencies property
    module.exports = function(dep1, dep2) {
    // body of singleton service
    module.exports.dependencies = ['dep1', 'dep2']
  • If a dependency doesn't exist in /services that it tries to load the @ghostmonitor/recart-di-<depname> npm package.

#Usage services/index.js:

const Bottle = require('bottlejs')
const di = new Bottle()
const loader = require('@ghostmonitor/recart-di-loader')

module.exports = di.container

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.