Created
June 11, 2021 22:40
-
-
Save Lcfvs/86d1d7435b1b4ac5970be7432b885ea9 to your computer and use it in GitHub Desktop.
fileToURI.js
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 fileToURI = async file => new Promise((onload, onerror) => | |
Object.assign(new FileReader(), { onload, onerror }) | |
.readAsDataURL(file)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment