Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/kd_clients/mod.ts>ReleaseClient#downloadAssetById

Various HTTP clients for miscellaneous use.
Latest
method ReleaseClient.prototype.downloadAssetById
import { ReleaseClient } from "https://deno.land/x/kd_clients@v1.0.0-preview.14/mod.ts";

Downloads an asset with an id that matches the given assetId to the given dirPath.

Parameters

assetId: number

The id of the asset to download.

dirPath: string

The directory path to download the asset to.

fileName: string

The name of the file when downloaded.

optional
overwrite: boolean

True to overwrite the file if it exists, otherwise false.

optional
onProgress: (assetId: number, filePath: string) => void

A callback function that is called when an asset is downloaded.

Returns

Promise<void>