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

Method load

lib/internal/modules/esm/loader.js:781–787  ·  view source on GitHub ↗

* Provide source that is understood by one of Node's translators. Handles customization hooks, * if any. * @typedef {{ * format: ModuleFormat, * source: ModuleSource, * responseURL?: string, * isSourceLoadedSynchronously: boolean, * }} LoadResult * @param {string} url

(url, context)

Source from the content-addressed store, hash-verified

779 * @returns {Promise<LoadResult> | LoadResult}}
780 */
781 load(url, context) {
782 if (this.isForAsyncLoaderHookWorker) {
783 // TODO(joyeecheung): invoke the synchronous hooks in the default step on loader thread.
784 return this.#asyncLoaderHooks.load(url, context);
785 }
786 return this.#loadSync(url, context);
787 }
788
789 /**
790 * This is the default load step for module.registerHooks(), which incorporates asynchronous hooks

Callers 2

loadAndTranslateMethod · 0.95
loader.jsFile · 0.45

Calls 1

#loadSyncMethod · 0.95

Tested by

no test coverage detected