@file-services/cached
v9.4.1
Published
A file system wrapper that adds cache to any `IFileSystem` implementation.
Downloads
2,608
Readme
@file-services/cached
A file system wrapper that adds cache to any IFileSystem
implementation.
Getting started
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");
License
MIT