i am trying to pass a token in the header when requesting to API to download a file, how do I pass auth header using the "download" package of npm
Npm package: https://www.npmjs.com/package/download
Here is my code
const download = require("download") const getCsvFiles = async (url, fileName, token) => { const filePath = path.resolve(__dirname, "Files"); const data = await download(url, filePath, {extract: true, filename: fileName}); };
1.4m articles
1.4m replys
5 comments
57.0k users