npm.io
1.0.1 • Published 5 years ago

@artossystems/configured

Licence
ISC
Version
1.0.1
Deps
0
Size
1 kB
Vulns
0
Weekly
0

Configured

This is a tiny dependency injection framework.

Installation

npm install @artossystems/configured

Usage Example

Configuration

In the file src/configured.js

const configured = require('@artossystems/configured')

module.exports = configured({
    item1: function constructItem1 () {
      // item 1 is constructed here
      return ret
    },

    item2: function () {
      // item 2 is constructed here
      // can refer to item1 as `this.item1` at which point it will be
      // constructed
      return ret
    }  
  })
Using
const configured = require('./configured')
configured.item1.method('param1')