constructor
vfs.MemoryProvider.constructor
Not implemented in Bun
Referenced types
class MemoryProvider
The default in-memory provider. Stores files, directories, and symbolic links in a Map-backed tree, supports symlinks (supportsSymlinks === true), and supports watching (supportsWatch === true).
Locks the provider into read-only mode. Subsequent writes through any
VirtualFileSystemusing this provider throwEROFS. There is no way to revert the provider to writable.const vfs = require('node:vfs'); const provider = new vfs.MemoryProvider(); const myVfs = vfs.create(provider); myVfs.writeFileSync('/seed.txt', 'initial'); provider.setReadOnly(); myVfs.writeFileSync('/x.txt', 'fail'); // throws EROFS