MCPcopy Create free account
hub / github.com/11ty/dev-server / #readFile

Method #readFile

server.js:344–358  ·  view source on GitHub ↗
(filepath)

Source from the content-addressed store, hash-verified

342 }
343
344 #readFile(filepath) {
345 if(this.options.useCache && this.fileCache[filepath]) {
346 return this.fileCache[filepath];
347 }
348
349 let contents = fs.readFileSync(filepath, {
350 encoding: this.options.encoding,
351 });
352
353 if(this.options.useCache) {
354 this.fileCache[filepath] = contents;
355 }
356
357 return contents;
358 }
359
360 #getFileContents(localpath, rootDir) {
361 let filepath;

Callers 2

#getFileContentsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected