A simple file system interface for managing files in sandboxes.
fs
module of Blaxel SDK. This module provides essential operations for creating, reading, writing, copying, and deleting files and directories.
Set up authentication to Blaxel
.env
file (BL_WORKSPACE
and BL_API_KEY
, or see this page for other authentication options).writeTree
specifies the base directory for writing the file tree, eliminating the need to repeat the full path for each file.
watch
function monitors all file system changes in the specified directory. You can also watch subdirectories by passing a /my/directory/**
pattern.
By default (when withContent: false), the events will only include metadata about the changes, not the actual file contents. Here’s what you’ll get in the callback events:
/**
:
withContent: true
so the events include the actual file contents.