Skip to content

importModule

importModule<T>(id, resolvePaths?): Promise<T>

Defined in: packages/node/src/module/import-module.ts:12

Import module at runtime with custom resolve paths.

If used, the resolve paths will be used instead of the default node.js ones, except for the GLOBAL_FOLDERS like $HOME/.node_modules, which are always included.

T

string

The module to load

string[]

The paths to use to resolve the module

Promise<T>

The loaded module