register

external fun <Data> register(specifier: String)(source)
external fun <Data> register(specifier: String, parentURL: String = definedExternally, options: RegisterOptions<Data> = definedExternally)(source)
external fun <Data> register(    specifier: String,     parentURL: <Error class: unknown class> = definedExternally,     options: RegisterOptions<Data> = definedExternally)(source)
external fun <Data> register(specifier: <Error class: unknown class>)(source)
external fun <Data> register(    specifier: <Error class: unknown class>,     parentURL: String = definedExternally,     options: RegisterOptions<Data> = definedExternally)(source)
external fun <Data> register(    specifier: <Error class: unknown class>,     parentURL: <Error class: unknown class> = definedExternally,     options: RegisterOptions<Data> = definedExternally)(source)

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

Since

v20.6.0, v18.19.0

Parameters

specifier

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

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


external fun <Data> register(specifier: String, options: RegisterOptions<Data> = definedExternally)(source)
external fun <Data> register(specifier: <Error class: unknown class>, options: RegisterOptions<Data> = definedExternally)(source)