download

Download a file.

PARAMETERS
fileId: string

The identifier of the file to download.

chunkSize?: number

Size of each download chunk in bytes.

offset?: number

Download offset in bytes.

RESULT
AsyncGenerator<Uint8Array, void, unknown>

A generator yielding the contents of the file.

SYNTAX
// Required parameters only.
await client.download(fileId);

// Required parameters + optional parameters.
// Any of the optional parameters can be omitted.
await client.download(fileId, { chunkSize, offset });
EXAMPLES
for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
  await outFile.write(chunk);
}