Node.js Buffer All In One
Buffer.from
https://nodejs.org/api/buffer.html#buffer
ArrayBuffer
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer
https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer
demos
const fs = require("fs");
var path = require("path");
const { exit } = require("process");
// axios
const axios = require("axios");
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('
标签:Node,const,log,Buffer,js,pdf,folder,filename
From: https://www.cnblogs.com/xgqfrms/p/17357737.html