1.0.1 • Published 3 years ago

@artossystems/configured v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

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')