Created
March 20, 2021 01:10
-
-
Save jbueza/2cecc7b82f0dd76e804f6770b69ce06d to your computer and use it in GitHub Desktop.
Using nodejs and axios to download webm file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const axios = require('axios'); | |
(async () => { | |
try { | |
const {data} = await axios.get(SOME_URL_TO_WEBM_FILE, {responseType: 'arraybuffer'}); | |
return fs.writeFileSync(`test.webm`, data, 'binary'); | |
} catch (err) { | |
console.log(err); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment