Created
November 8, 2021 10:15
-
-
Save talaikis/1fef7d2e4de64c0f9660311248b8afe9 to your computer and use it in GitHub Desktop.
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
import { saveAs } from 'file-saver' | |
const base64Data = '' | |
const imgBuff = Buffer.from(base64Data.replace(/^data:image\/\w+;base64,/, ''), 'base64') | |
const blob = new Blob([new Uint8Array(imgBuff).buffer]) | |
saveAs(blob) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment