Download data stream files via axios
npm install axios-streamDownload stream files via axios
!Logo
>This library is only suitable for WEB projects that use axios as the HTTP request library
>Please install axios first, and then use axios-stream
Using Axios and Blob objects to achieve file stream download
npm install axios-stream or yarn add axios-stream
import AxiosStream from "axios-stream";
``typescript
const downFileName='today'
const extensionName='xlsx'
const axiosConfig={
method: 'get',
url: '/user/12345',
}
AxiosStream.download(downFileName, extensionName, axiosConfig);
``
Enter the path and file name you want to download
> the file name must include the extension**
#### Thanks
>This method originated from the Internet and was inspired by chennvwang