The filesystem capability seam — the one allowed filesystem-access point, behind
an injectable FileSystem.
Production code depends on the FileSystem interface, not on node:fs directly.
The default implementation is the real filesystem; a test (or a sandbox) injects
its own, so disk access is both enumerable and substitutable.
npm install @bounded-systems/fsimport{defaultFileSystem,statPath,removeFile,typeFileSystem,typeFileStat,}from"@bounded-systems/fs";// Depend on the port; default to the real filesystem.asyncfunctionload(fs: FileSystem=defaultFileSystem){conststat: FileStat|null=awaitstatPath(fs,"config.json");// …}// In a test, pass an in-memory FileSystem instead.- Capability seam. Callers receive a
FileSystemrather than reaching fornode:fs, so filesystem access is injectable and auditable. - Leaf package. Touches node builtins only and carries no ambient authority beyond the filesystem it mediates — an extractability test enforces it.
MIT © Bounded Systems