Kind: Class
Source: packages/core/injector/internal-core-module/internal-core-module.ts
Part of: Core
InternalCoreModule is a framework-internal global module that registers core dependency-injection providers used by the application container. Its register() method returns a DynamicModule, allowing the framework to supply container-specific services during application initialization.
Methods
| Method | Signature | Returns |
|---|---|---|
register | `register(providers: Array<ValueProvider | FactoryProvider |
Diagram
mermaidgraph LR A[Application Bootstrap] --> B[InternalCoreModule.register()] B --> C[DynamicModule] C --> D[Core DI Providers] D --> E[Application Injector / Container] E --> F[Framework Services]
Usage
tsimport { Module } from '@nestjs/common';
import { InternalCoreModule } from './injector/internal-core-module/internal-core-module';
@Module({
imports: [
// Normally registered internally by the framework bootstrap process.
InternalCoreModule.register(),
],
})
export class AppModule {}
AI Coding Instructions
- Treat
InternalCoreModuleas framework infrastructure; application modules should generally not import it directly. - Keep
register()focused on returning a validDynamicModuleand registering only core container providers. - Ensure providers added during registration are compatible with the injector lifecycle and scope rules.
- Preserve the module’s global/core role when changing exports or registered providers.
- Prefer integrating new framework-level services through the bootstrap/container setup rather than manually instantiating them.
Relationships
- IMPORTS →
DynamicModule - IMPORTS →
Global - IMPORTS →
Module - IMPORTS →
ExistingProvider - IMPORTS →
FactoryProvider - IMPORTS →
ValueProvider
Was this page helpful?