Socket
Book a DemoInstallSign in
Socket

@tosspayments/n8n__di

Package Overview
Dependencies
Maintainers
20
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tosspayments/n8n__di

`@n8n/di` is a dependency injection (DI) container library, based on [`typedi`](https://github.com/typestack/typedi).

latest
npmnpm
Version
0.9.0
Version published
Weekly downloads
0
-100%
Maintainers
20
Weekly downloads
 
Created
Source

@n8n/di

@n8n/di is a dependency injection (DI) container library, based on typedi.

n8n no longer uses typedi because:

  • typedi is no longer officially maintained
  • Need for future-proofing, e.g. stage-3 decorators
  • Small enough that it is worth the maintenance burden
  • Easier to customize, e.g. to simplify unit tests

Usage

// from https://github.com/typestack/typedi/blob/develop/README.md
import { Container, Service } from 'typedi';

@Service()
class ExampleInjectedService {
  printMessage() {
    console.log('I am alive!');
  }
}

@Service()
class ExampleService {
  constructor(
    // because we annotated ExampleInjectedService with the @Service()
    // decorator TypeDI will automatically inject an instance of
    // ExampleInjectedService here when the ExampleService class is requested
    // from TypeDI.
    public injectedService: ExampleInjectedService
  ) {}
}

const serviceInstance = Container.get(ExampleService);
// we request an instance of ExampleService from TypeDI

serviceInstance.injectedService.printMessage();
// logs "I am alive!" to the console

Requires enabling these flags in tsconfig.json:

{
  "compilerOptions": {
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true
  }
}

FAQs

Package last updated on 14 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts