MCPcopy Create free account
hub / github.com/angular/angular / readFile

Function readFile

packages/core/schematics/utils/project_tsconfig_paths.ts:95–102  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

93function createHost(tree: Tree): workspaces.WorkspaceHost {
94 return {
95 async readFile(path: string): Promise<string> {
96 const data = tree.read(path) as unknown as virtualFs.FileBuffer;
97 if (!data) {
98 throw new Error('File not found.');
99 }
100
101 return virtualFs.fileBufferToString(data);
102 },
103 async writeFile(path: string, data: string): Promise<void> {
104 return tree.overwrite(path, data);
105 },

Callers

nothing calls this directly

Calls 1

readMethod · 0.65

Tested by

no test coverage detected