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

Function load

test/fixtures/es-module-loaders/loader-load-source-maps.mjs:3–9  ·  view source on GitHub ↗
(url, context, nextLoad)

Source from the content-addressed store, hash-verified

1import { readFile } from 'node:fs/promises';
2
3export async function load(url, context, nextLoad) {
4 const resolved = await nextLoad(url, context);
5 if (context.format === 'commonjs') {
6 resolved.source = await readFile(new URL(url));
7 }
8 return resolved;
9}

Callers

nothing calls this directly

Calls 1

readFileFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…