@tshio/awilix-resolver
v2.0.1
Published
Awilix Resolver
Downloads
444
Readme
Awilix Resolver
Non-blocking Awilix Resolver library for Node.js.
This is a 100% JavaScript library, with TypeScript definition, with the Promise API.
Awilix version required 4.3.1 or above
Installing
$ npm install @tshio/awilix-resolver
$ npm install awilix
or
$ yarn add @tshio/awilix-resolver
$ yarn add awilix
Usage
// CommonJS
const { asArray } = require("@tshio/awilix-resolver");
// ES Module
import { asArray } from "@tshio/awilix-resolver";
import * as awilix from "awilix";
// SUBSCRIBERS_IMPORTS
import ExampleSubscriber from "example-subscriber";
export async function registerSubscribers(container: AwilixContainer) {
container.register({
eventSubscribers: asArray<any>([
// SUBSCRIBERS_SETUP
awilix.asClass(ExampleSubscriber).singleton(),
]),
});
return container;
}
License
This project is licensed under the terms of the MIT license.
About us:
The Software House