https://www.npmjs.com/package/typedi

    1. import { Container } from 'typedi';
    2. class ExampleClass {
    3. print() {
    4. console.log('I am alive!');
    5. }
    6. }
    7. /** Request an instance of ExampleClass from TypeDI. */
    8. const classInstance = Container.get(ExampleClass);
    9. /** We received an instance of ExampleClass and ready to work with it. */
    10. classInstance.print();