base64 working?? also 100th commit :D

This commit is contained in:
Conrad
2021-06-19 20:28:29 -04:00
parent e2825950eb
commit 61088811db
3 changed files with 45 additions and 22 deletions

22
src/toBase64.ts Normal file
View File

@@ -0,0 +1,22 @@
const imageToBase64 = require('image-to-base64');
const encodeBase64 = async (url: string): Promise<string> => {
let encoded: string = '';
await imageToBase64(url)
.then(
(response: string) => {
return encoded = response;
}
)
.catch(
(error: any) => {
console.log(error);
}
)
return encoded;
}
export default encodeBase64;