Skip to content

Function: downloadByBlob()

ts
function downloadByBlob(dataStream, fileName?): void;

Downloads a file from a Blob object by creating a temporary object URL and clicking a link with a download attribute.

Parameters

ParameterTypeDefault valueDescription
dataStreamBlobPartundefinedThe data to download as a Blob object.
fileNamestring'unknown'The name to use for the downloaded file. Defaults to 'unknown'.

Returns

void

Example

ts
downloadByBlob('hello,world', 'export')
console.log('triggered')

Since

1.0.0

Released under the MIT License.