MCPcopy Create free account
hub / github.com/observablehq/framework / resolveNodeImports

Function resolveNodeImports

src/node.ts:61–64  ·  view source on GitHub ↗
(root: string, path: string)

Source from the content-addressed store, hash-verified

59 * "/_node/d3-array@3.2.4/src/index.js", returning a set of node import paths.
60 */
61export async function resolveNodeImports(root: string, path: string): Promise<ImportReference[]> {
62 if (!path.startsWith("/_node/")) throw new Error(`invalid node path: ${path}`);
63 return parseImports(join(root, ".observablehq", "cache"), path);
64}
65
66/**
67 * Given a local npm path such as "/_node/d3-array@3.2.4/src/index.js", returns

Callers 3

node-test.tsFile · 0.85
resolveResolversFunction · 0.85
getModuleStaticImportsFunction · 0.85

Calls 1

parseImportsFunction · 0.85

Tested by

no test coverage detected