@bjorkhaug/sdi
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

Simple Service Dependency Injection for Deno and Node.js

This module provides a simple service dependency injection system for Deno and Node.js applications.

import { Container, Service } from '@bjorkhaug/sdi'

@Service()
class ServiceA {
  // Your service code here
}

@Service()
class ServiceB {
  constructor(private readonly a: ServiceA) {}
  // Your service code here
}

const myServiceInstance = Container.get(ServiceB)

Note that the typescript compiler must emit metadata for this to work as we rely on typescript metadata features.

Readme

Keywords

none

Package Sidebar

Install

npm i @bjorkhaug/sdi

Weekly Downloads

0

Version

0.0.4

License

MIT

Unpacked Size

5.35 kB

Total Files

16

Last publish

Collaborators

  • simenbjorkhaug