const string = await loadTextFile('../foo.txt');
function loadTextFile(path){
return new Promise((resolve, reject) => {
fetch(path)
.then(response => response.text(), reject)
.then(data => resolve(data), reject);
});
}