Module.GlobalPreloadHook - Node documentation
type alias Module.GlobalPreloadHook

Usage in Deno

import { type Module } from "node:module";
type { GlobalPreloadHook } = Module;
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