Created
August 22, 2021 18:26
-
-
Save RayyanNafees/8c7993d2a361b0a5407927c737cee7df to your computer and use it in GitHub Desktop.
This file contains hidden or 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 b64 = file => new Promise((resolve, reject)=>{ | |
const reader = new FileReader(); | |
reader.onload = ()=>resolve(reader.result); | |
reader.onerror = () => reject(reader.result); | |
reader.readAsDataURL(file) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A promise for creating getting base64 of a file like