1.0.0-alpha.1.7 • Published 6 years ago
@midgar/services v1.0.0-alpha.1.7
In Dev don't use this
@midgar/services
It a plugin for Midgar to add services with dependency injection
Installation
$ npm install @midgar/services --save
Plugin dir
This plugin add a services plugin dir. It load all services in this directories.
Get service
This plugin add a function "getService" on Midgar instance
const serviceInstance = await midgar.getService('myService')
or
midgar.getService('myService').then(serviceInstance => {
...
})
Service définition
Function service:
function myService(midgar, db) {
...
}
module.exports = {
service: myService,
dependencies: [
'db'
]
}
Class service:
class MyService {
constructor(midgar, db) {
}
}
module.exports = {
service: myService,
dependencies: [
'db'
]
}
1.0.0-alpha.1.7
6 years ago
1.0.0-alpha.1.6
6 years ago
1.0.0-alpha.1.5
6 years ago
1.0.0-alpha.1.4
6 years ago
1.0.0-alpha.1.3
6 years ago
1.0.0-alpha.1.2
6 years ago
1.0.0-alpha.1.1
6 years ago
1.0.0-alpha.1.0
6 years ago