Skip to main content
Module.GlobalPreloadHook - node__module.d.ts - Node documentation
type alias Module.GlobalPreloadHook

Usage in Deno

```typescript import { Module } from "node:node__module.d.ts"; ```
Deprecated
This hook will be removed in a future version. Use `initialize` instead. When a loader has an `initialize` export, `globalPreload` will be ignored. Sometimes it might be necessary to run some code inside of the same global scope that the application runs in. This hook allows the return of a string that is run as a sloppy-mode script on startup.

Definition

(context: GlobalPreloadContext) => string