@nestjs/common
Version:
Nest - modern, fast, powerful node.js web framework (@common)
18 lines (17 loc) • 562 B
JavaScript
import { GLOBAL_MODULE_METADATA } from '../../constants.js';
/**
* Decorator that makes a module global-scoped.
*
* Once imported into any module, a global-scoped module will be visible
* in all modules. Thereafter, modules that wish to inject a service exported
* from a global module do not need to import the provider module.
*
* @see [Global modules](https://docs.nestjs.com/modules#global-modules)
*
* @publicApi
*/
export function Global() {
return (target) => {
Reflect.defineMetadata(GLOBAL_MODULE_METADATA, true, target);
};
}