const readFile = async file => { var response = await fetch(file), text = await response.text(); console.log(text); }; readFile('name.txt');