12 lines
237 B
JavaScript
12 lines
237 B
JavaScript
async function getPathText(path)
|
|
{
|
|
const response = await fetch(path);
|
|
if (!response.ok) {
|
|
throw new Error(`${path}: ${response.status}`)
|
|
}
|
|
const blob = await response.blob();
|
|
return blob.text();
|
|
}
|
|
|
|
export { getPathText };
|