Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 847 Bytes

README.md

File metadata and controls

36 lines (24 loc) · 847 Bytes

@file-services/cached

npm version package size

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