Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
12 lines
406 B
Text
12 lines
406 B
Text
import { readFile as fsReadFile } from "node:fs/promises";
|
|
export const filePromises = {};
|
|
export const fileIntercept = {};
|
|
export const readFile = (path, options) => {
|
|
if (fileIntercept[path] !== undefined) {
|
|
return fileIntercept[path];
|
|
}
|
|
if (!filePromises[path] || options?.ignoreCache) {
|
|
filePromises[path] = fsReadFile(path, "utf8");
|
|
}
|
|
return filePromises[path];
|
|
};
|