async function readFile(file) {
const text = await file.text();
console.log(text); // Will output: "my name is x"
return text;
}
// Usage
fileInput.addEventListener('change', async (e) => {
const text = await readFile(e.target.files[0]);
// Use your text here
});