anti-di
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Anti DI

Tiny, easy to use IoC Dependency Injection container made for Typescript/Javascript

No container declaration.
No Reflect Metadata.
No unnecessary decorators.
No over the top features.
Simple Static Singleton Pattern.

Usage

// Extend Injectable to make a class Injectable
export class MyClass extends Injectable {
    ...
}

// Use Injectable class
export class UserService {
    private readonly myClass = MyClass.getInstance<MyClass>(MyClass);
}

It only supports property injection which is enough for most use cases. For constructor based injection checkout tsyringe, inversify, typedi.

It uses inheritance to maintain references inside the object so you don't have to maintain containers separately.

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i anti-di

    Weekly Downloads

    1

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    3.44 kB

    Total Files

    6

    Last publish

    Collaborators

    • bloodred17