deno.com

function Module.register

Overload 1

#register<Data = any>(
specifier: string | URL,
parentURL?: string | URL,
options?: RegisterOptions<Data>,
): void

Register a module that exports hooks that customize Node.js module resolution and loading behavior. See Customization hooks.

This feature requires --allow-worker if used with the Permission Model.

Type Parameters #

#Data = any

Parameters #

#specifier: string | URL

Customization hooks to be registered; this should be the same string that would be passed to import(), except that if it is relative, it is resolved relative to parentURL.

#parentURL: string | URL
optional

f you want to resolve specifier relative to a base URL, such as import.meta.url, you can pass that URL here.

#options: RegisterOptions<Data>
optional

Return Type #

void

Overload 2

#register<Data = any>(
specifier: string | URL,
options?: RegisterOptions<Data>,
): void

Type Parameters #

#Data = any

Parameters #

#specifier: string | URL
#options: RegisterOptions<Data>
optional

Return Type #

void