Getting Started
Installation
pnpm add @anymux/cacheBasic Usage
import { CachedFileSystem } from "@anymux/cache";
import { S3FileSystem } from "@anymux/s3";
const s3 = new S3FileSystem({ bucket: "my-bucket", region: "us-east-1" });
const fs = new CachedFileSystem({ fs: s3 });
// First read fetches from S3
const content = await fs.readFile("/data.json");
// Second read is served from cache
const cached = await fs.readFile("/data.json");