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

Method write

packages/llm/src/stores/file/index.ts:6–14  ·  view source on GitHub ↗
({ dir, files })

Source from the content-addressed store, hash-verified

4
5class FileStore {
6 static async write({ dir, files }) {
7 fs.mkdirSync(dir, { recursive: true });
8 for (const file of files) {
9 if (isFileValid(file)) {
10 const filename = StringUtils.clean(file.metadata.source);
11 fs.writeFileSync(`${dir}/${filename}.json`, JSON.stringify(file));
12 }
13 }
14 }
15
16 static async read({ dir }) {
17 const files = fs.readdirSync(dir);

Callers 5

crawlMethod · 0.80
buildCustomDomainSitemapFunction · 0.80
buildLinenSitemapFunction · 0.80
getServerSidePropsFunction · 0.80
getServerSidePropsFunction · 0.80

Calls 2

isFileValidFunction · 0.90
cleanMethod · 0.80

Tested by

no test coverage detected