@fatcherjs/middleware-progress
v3.0.0-alpha-10
Published
<a href="https://npmjs.com/package/@fatcherjsjs/middleware-progress"><img src="https://img.shields.io/npm/v/@fatcherjsjs/middleware-progress.svg" alt="npm package"></a> [![install size](https://packagephobia.com/badge?p=@fatcherjs/middleware-progress)](ht
Downloads
567
Readme
@fatcherjs/middleware-progress
Install
NPM
>$ npm install @fatcherjs/middleware-progress
CDN
<script src="https://cdn.jsdelivr.net/npm/@fatcherjs/middleware-progress/dist/index.min.js"></script>
Usage
import { fatcher } from 'fatcher';
import { progress } from '@fatcherjs/middleware-progress';
fatcher('https://foo.bar', {
middlewares: [progress()],
});
Options
onDownloadProgress
import { fatcher } from 'fatcher';
import { progress } from '@fatcherjs/middleware-progress';
fatcher('https://foo.bar', {
middlewares: [progress()],
onDownloadProgress: (current, total) => {
// current received data length
// total data length
},
});