readFile() / read_file() method.
import fs from 'fs'
import { Volume } from 'e2b'
const volume = await Volume.create('my-volume')
// Read file from volume
const content = await volume.readFile('/path/in/volume')
// Write file to local filesystem
fs.writeFileSync('/local/path', content)
from e2b import Volume
volume = Volume.create('my-volume')
# Read file from volume
content = volume.read_file('/path/in/volume')
# Write file to local filesystem
with open('/local/path', 'w') as file:
file.write(content)