vfs.vfsBase()
返回保存每个已挂载虚拟文件系统挂载点的目录,即 path.join(os.devNull, 'vfs')。读取它会列出已挂载的内容;参见 保留的根目录。
🌐 Returns the directory that holds the mount points of every mounted virtual file
system, which is path.join(os.devNull, 'vfs'). Reading it lists what is
mounted; see The reserved root directory.
const vfs = require('node:vfs');
const fs = require('node:fs');
const myVfs = vfs.create();
const mountPoint = myVfs.mount();
fs.readdirSync(vfs.vfsBase()); // The name of every mount point in it
mountPoint.startsWith(vfs.vfsBase()); // true