knifecycle
knifecycle copied to clipboard
Manage your NodeJS processes's lifecycle automatically with an unobtrusive dependency injection implementation.
See NodeJS exit codes documentation: `13 Unfinished Top-Level Await: await was used outside of a function in the top-level code, but the passed Promise never resolved.` https://nodejs.org/api/process.html#exit-codes I suspect an...
Some services, like `$fatalError` should probably be singletons since they concern the processes (its only use is atm here: https://github.com/nfroidure/common-services/blob/main/src/process.ts#L84-L88 Some other ain't that simple to determine INJECTOR and SILO_CONTEXT...
The `$inject`, `$shutdown`, `$dispose`, `$autoload` and `$instance` internal services should be documented and their interface should be specified in the types definitions.
In order to allow users to override it and get auto-completion for services injections, a global Services interface mapping to all services types could be useful. It would give something...
Currently the `whook` autoloader allows to map service names via a constant called `SERVICE_NAME_MAP`. It works well until one load a service outside of the autoloader. Integrating it directly inside...
Those names are confusing and led to bugs, best would be to name them like that `serviceAlias>serviceCanonicalName` to avoid any misunderstanding.
May be nice to auto detect service / provider initializers with a distinct prefix.
Would be nice to allow to specify that the injector is used in singleton context to avoid loading non-singletons into singletons.
Would be nice to know which services were not used in order to have insights on what could be cleaned up.