NestJS · Junior · Question 12 of 75
Are module providers singletons by default?
- 1No, a new instance is created for every request
- 2No, a new instance is created for every injection
- ✓Correct answer: Yes, one instance is created and shared across the whole application
Explanation
The default scope is singleton. Request and transient scopes exist but have a performance cost.