downloadFile
function downloadFile(options: DownloadFileOptions): Promise<TransferReceipt>;Defined in: src/client/operations.ts:138
Downloads a single remote file to a local path.
The remote provider is resolved from source.profile.provider. The local
destination path is created (including parent directories) on demand.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | DownloadFileOptions | Friendly download options. |
Returns
Section titled “Returns”Promise<TransferReceipt>
Receipt produced by the underlying transfer engine.
Example
Section titled “Example”import { createS3ProviderFactory, createTransferClient, downloadFile,} from "@zero-transfer/sdk";
const client = createTransferClient({ providers: [createS3ProviderFactory()] });
await downloadFile({ client, localPath: "./tmp/snapshot.tar.gz", source: { path: "snapshots/2026-04-28/snapshot.tar.gz", profile: { host: "snapshots", // S3 bucket provider: "s3", s3: { region: "us-east-1" }, }, },});