>$ npm install @fatcherjs/middleware-progress<script src="https://cdn.jsdelivr.net/npm/fatcher/dist/fatcher.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@fatcherjs/middleware-progress/dist/index.min.js"></script>
<script>
Fatcher.fatcher('url', {
middlewares: [FatcherMiddlewareProgress],
onDownloadProgress: (current, total) => {
// process progress
},
}).then(response => {
console.log(response);
});
</script>import { fatcher } from 'fatcher';
import { progress } from '@fatcherjs/middleware-progress';
fatcher('https://foo.bar', {
middlewares: [progress],
});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
},
});