Вы можете найти свое имя файла в ответе axios
var axios = require('axios')
var fs = require('fs')
axios({
method:'get',
url:'https://myapi.com/files/4hjiguo4ho45946794526975429',
responseType:'stream'
})
.then(function(response) {
let headerLine = response.data.headers['content-disposition']
let startFileNameIndex = headerLine.indexOf('"') + 1
let endFileNameIndex = headerLine.lastIndexOf('"')
let filename = headerLine.substring(startFileNameIndex, endFileNameIndex)
response.data.pipe(fs.createWriteStream(filename))
});
Надеюсь, этот ответ помог вам