MCPcopy Create free account
hub / github.com/Oslonline/dithering-studio / readFileIfExists

Function readFileIfExists

scripts/prerender.mjs:63–71  ·  view source on GitHub ↗
(filePath)

Source from the content-addressed store, hash-verified

61};
62
63const readFileIfExists = async (filePath) => {
64 try {
65 const stat = await fs.stat(filePath);
66 if (!stat.isFile()) return null;
67 return await fs.readFile(filePath);
68 } catch {
69 return null;
70 }
71};
72
73const createStaticServer = async () => {
74 const server = http.createServer(async (req, res) => {

Callers 1

createStaticServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected