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

Method writeFile

src/build.ts:516–522  ·  view source on GitHub ↗
(outputPath: string, contents: string | Buffer)

Source from the content-addressed store, hash-verified

514 await copyFile(sourcePath, destination);
515 }
516 async writeFile(outputPath: string, contents: string | Buffer): Promise<void> {
517 const destination = join(this.outputRoot, outputPath);
518 this.logger.log(destination);
519 await prepareOutput(destination);
520 if (existsSync(destination)) throw new Error(`file conflict: ${outputPath}`);
521 await writeFile(destination, contents);
522 }
523 async writeBuildManifest(buildManifest: BuildManifest): Promise<void> {
524 const destination = join(this.cacheDir, "_build.json");
525 await prepareOutput(destination);

Callers

nothing calls this directly

Calls 4

existsSyncFunction · 0.85
logMethod · 0.80
prepareOutputFunction · 0.70
writeFileFunction · 0.70

Tested by

no test coverage detected