MCPcopy Index your code
hub / github.com/nodejs/node / defaultImportModuleDynamicallyForModule

Function defaultImportModuleDynamicallyForModule

lib/internal/modules/esm/utils.js:212–215  ·  view source on GitHub ↗

* Proxy the dynamic import handling to the default loader for source text modules. * @param {string} specifier - The module specifier string. * @param {number} phase - The module import phase. * @param {Record } attributes - The import attributes object. * @param {string|null|unde

(specifier, phase, attributes, referrerName)

Source from the content-addressed store, hash-verified

210 * @returns {Promise<import('internal/modules/esm/loader.js').ModuleExports>} - The imported module object.
211 */
212function defaultImportModuleDynamicallyForModule(specifier, phase, attributes, referrerName) {
213 const cascadedLoader = require('internal/modules/esm/loader').getOrInitializeCascadedLoader();
214 return cascadedLoader.import(specifier, referrerName, attributes, phase);
215}
216
217/**
218 * Proxy the dynamic import to the default loader for classic scripts.

Callers 1

Calls 2

importMethod · 0.80
requireFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…