How to use axios.js instead of request.js to get data as a buffer All In One
如何使用 axios.js 代替 request.js 获取数据作为缓冲区
question
const fs = require("fs");
var path = require("path");
const { exit } = require("process");
// request
const request = require("request");
// const request = require("request-promise-native");
const log = console.log;
var folder = path.resolve(__dirname, '../pdf');
// log('folder', folder);
if (!fs.existsSync(folder)) {
fs.mkdirSync(folder);
}
async function downloadPDF(url, filename) {
log('
标签:use,axios,const,log,request,filename,fs,folder,js
From: https://www.cnblogs.com/xgqfrms/p/17357705.html