its a image convertor to base64 async
npm install base64-encode-filebash
npm i base64-encode-file
`
* After the Installation check in the package.json file wither it
is installed or not.
`bash
"base64-encode-file": "^1.0.1",
`
* Working Example with React.JS is as follows:
`bash
import logo from './logo.svg';
import './App.css';
import {useState} from 'react'
import base64 from 'base64-encode-file'
function App() {
let [img,setImg]=useState()
let handleChange=async(e)=>{
let data=await base64(e.target.files[0])
console.log(data)
}
return <>
testing the base64-encode-file
>
}
export default App;
`
* Working Example with React.TS is as follows:
`bash
import React from 'react';
import logo from './logo.svg';
import './App.css';
import base64 from 'base64-encode-file'
function App() {
let handleChange=async(e:any)=>{
console.log( await base64(e.target.files[0]))
}
return (
<>
>
);
}
export default App;
`
Base64 code look like this:
* For Example in HTML Coding: `bash 
``