The base class for all VFS providers. Subclasses implement the essential
primitives (such as open, stat, readdir, mkdir, rmdir, unlink,
rename, etc.) and inherit default implementations of the derived
methods (such as readFile, writeFile, exists, copyFile, access, etc.).
Attributes
const { VirtualProvider } = require('node:vfs'); class StaticProvider extends VirtualProvider { get readonly() { return true; } statSync(path) { /* ... */ } openSync(path, flags) { /* ... */ } readdirSync(path, options) { /* ... */ } // ... }
The base class throws ERR_METHOD_NOT_IMPLEMENTED for any primitive
that has not been overridden, and rejects writes from a readonly
provider with EROFS.