Skip to content
E2B Docs
Volumes

Download data from volume

Download files from a volume to your local filesystem with the E2B SDK.

You can download data from a volume using the 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)
Was this page helpful?Suggest editsRaise issue