2.0.1 • Published 2 years ago

@tshio/awilix-resolver v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Awilix Resolver

npm version

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

license

This project is licensed under the terms of the MIT license.

About us:

The Software House