vfs.create([provider][, options])
providerVirtualProvider 要使用的提供者。默认:new MemoryProvider()。options<Object>emitExperimentalWarning<boolean> 在创建实例时是否发出实验性警告。默认值:true。
- 返回:VirtualFileSystem
方便工厂,相当于 new VirtualFileSystem(provider, options)。
🌐 Convenience factory equivalent to new VirtualFileSystem(provider, options).
const vfs = require('node:vfs');
// Default in-memory provider
const memoryVfs = vfs.create();
// Explicit provider
const realVfs = vfs.create(new vfs.RealFSProvider('/tmp/vfs-root'));