A file system wrapper that adds cache to any IFileSystem
implementation.
Install library in project:
npm i @file-services/cached
Then, use the programmatic API:
import { nodeFs } from "@file-services/node";
import { createCachedFs } from "@file-services/cached";
const cachedFs = createCachedFs(nodeFs);
cachedFs.writeFileSync("/file.js", "CONTENT");
// calls fs
cachedFs.statSync("/file.js");
// cached
cachedFs.statSync("/file.js");
// clears the cache
cachedFs.invalidate("/file.js");
MIT