Overview of memfs APIs and capabilities
mastermemfs is an in-memory file system that supports two primary interfaces:
- Node's
fsmodule: A drop-in replacement for the standard Node.jsfsmodule. It is ideal for mocks, tests, bundlers, and sandboxes where you want files to live in memory instead of on disk. - Browser File System Access (FSA) API: Implements the
FileSystemDirectoryHandleinterface, allowing you to use an in-memory filesystem in a browser environment.
Key Features:
- Cross-API Adapters: Includes adapters to translate between the
fsAPI and the FSA API, allowing you to runfs-based code in the browser on top of real directories, or expose anfs-like filesystem through FSA handles. - Runtime Support: Runs in Node.js, Deno, Bun, and browsers.
- Storage: Uses
Uint8Arraybuffers for file contents. - Ecosystem: Built from specialized
@jsonjoy.com/fs-*packages, including utilities for snapshots (POJO/CBOR/JSON) and ASCII tree printing.