MCPcopy
hub / github.com/markmap/markmap / FileSystemProvider

Class FileSystemProvider

packages/markmap-cli/src/util/dev-server.ts:103–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103class FileSystemProvider
104 extends BufferContentProvider
105 implements IContentProvider
106{
107 constructor(
108 key: string,
109 readonly filePath: string,
110 watch: (callback: () => void) => () => void,
111 ) {
112 super(key);
113 this.disposeList.push(watch(() => this.update()));
114 }
115
116 async update() {
117 const content = await readFile(this.filePath, 'utf8');
118 this.setContent(content);
119 }
120}
121
122function sha256(input: string) {
123 return createHash('sha256').update(input, 'utf8').digest('hex').slice(0, 7);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected