MCPcopy Index your code
hub / github.com/markmap/markmap / loadFile

Function loadFile

packages/markmap-cli/src/index.ts:25–33  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

23export * as markmap from 'markmap-lib';
24
25async function loadFile(path: string) {
26 if (path.startsWith(ASSETS_PREFIX)) {
27 const relpath = path.slice(ASSETS_PREFIX.length);
28 return readFile(resolve(config.assetsDir, relpath), 'utf8');
29 }
30 const res = await fetch(path);
31 if (!res.ok) throw res;
32 return res.text();
33}
34
35async function inlineAssets(assets: IAssets): Promise<IAssets> {
36 const [scripts, styles] = await Promise.all([

Callers 1

inlineAssetsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected