MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / read

Method read

packages/llm/src/stores/file/index.ts:16–27  ·  view source on GitHub ↗
({ dir })

Source from the content-addressed store, hash-verified

14 }
15
16 static async read({ dir }) {
17 const files = fs.readdirSync(dir);
18 return files.map((path) => {
19 const content = fs.readFileSync(`${dir}/${path}`, {
20 encoding: 'utf-8',
21 });
22 return {
23 path,
24 content,
25 };
26 });
27 }
28
29 static async has({ dir }) {
30 return fs.existsSync(dir);

Callers 1

getDocumentsMethod · 0.80

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected