@hoaphat/node-dependency-injection
TypeScript icon, indicating that this package has built-in type declarations

2.8.24 • Public • Published

node-dependency-injection

fork of origin https://www.npmjs.com/package/node-dependency-injection with custom code

npm i @hoaphat/node-dependency-injection

Additional features

  • Cancel register same bean by id, graceful return nothing
  • Added container.clear() to clear all beans+definitions+alias
  • Added container.bootstrap() to allow eager load all beans
  • Added container.asyncBootstrap() async version of func bootstrap
  • Added container.registerSyntheticAndSet(id, instance) to do "remove-then-set" synthetic-instance
  • Added container.waitAndGet(id, opts) to do "wait-for-async-bean" be ready
  • Added container.getOrDefault(id, defaults) to do return default-value if no bean existing instead of throw error

Dependencies (6)

Dev Dependencies (14)

Package Sidebar

Install

npm i @hoaphat/node-dependency-injection

Weekly Downloads

8

Version

2.8.24

License

MIT

Unpacked Size

224 kB

Total Files

60

Last publish

Collaborators

  • phuonghuynh