README
download
采用superagent
下载文件,返回promise对象
使用方法
const download = require('@chenchunyong/downloadfile');
download('xxx', 'xxxx').then(() => {
console.log('下载成功')
}).catch(e => {
console.log(e);
});
下载文件
<script type="module">
import chenchunyongDownloadfile from 'https://cdn.skypack.dev/@chenchunyong/downloadfile';
</script>
采用superagent
下载文件,返回promise对象
const download = require('@chenchunyong/downloadfile');
download('xxx', 'xxxx').then(() => {
console.log('下载成功')
}).catch(e => {
console.log(e);
});