设置
Usage with deepagents
Standalone usage
配置
工作原理
VFS uses a hybrid approach for maximum compatibility:- File storage: Files are stored in-memory using a virtual file system
- Command execution: When executing commands, files sync to a temp directory, the command runs, and changes sync back to VFS
- Fallback mode: If node-vfs-polyfill is unavailable, falls back to using a temp directory for both storage and execution
File operations
Factory functions
Error handling
Error codes
When to use VFS
Best suited for:- Local development and testing
- CI/CD pipelines without Docker
- Quick prototyping without cloud setup
- Environments where external services aren’t available
- Production workloads requiring true container isolation
- Persistent storage across sessions
- Heavy computational tasks (no resource limits)
Future: Native Node.js VFS
This package uses node-vfs-polyfill which implements the upcoming Node.js VFS feature being developed in nodejs/node#61478. When the officialnode:vfs module lands in Node.js, this package will be updated to use the native implementation.
将这些文档连接到 Claude、VSCode 等工具,通过 MCP 获取实时答案。

