Upload files to the sandbox.
Files are written to the sandbox filesystem using Modal's file API. Parent directories are created automatically if they don't exist.
uploadFiles(files: [string, Uint8Array<ArrayBufferLike>][]): Promise<FileUploadResponse[]>| Name | Type | Description |
|---|---|---|
files* | [string, Uint8Array<ArrayBufferLike>][] | Array of [path, content] tuples to upload |
const encoder = new TextEncoder();
const results = await sandbox.uploadFiles([
["src/index.js", encoder.encode("console.log('Hello')")],
["package.json", encoder.encode('{"name": "test"}')],
]);