README
duckfficer-method-di
loads duckfficer-method entities from a path to provide a pleasure-di container
Installation
$ npm i duckfficer-method-di --save
# or
$ yarn add duckfficer-method-di
Features
- builds an object appending all method found in given paths
- validates input
- validates output
- emits events
builds an object appending all method found in given paths
const container = duckfficerMethodDi({
Gateway: 'gateways',
Service: 'services'
}, {
baseDir: path.join(__dirname, './__tests__/fixtures')
})
const { OrderService } = container
t.deepEqual(await OrderService.payment({
id: '123',
amount: 99
}), {
id: '123',
result: 'paying 99