Setup
Usage with deepagents
Standalone usage
Configuration
How it works
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.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

