webgl/public/gl/io/file.js

11 lines
222 B
JavaScript
Raw Normal View History

2023-01-19 03:43:02 +00:00
export { readFileAsync }
2023-01-18 14:30:41 +00:00
2023-01-19 03:43:02 +00:00
const readFileAsync = async (path) => {
2023-01-18 14:30:41 +00:00
try {
let data = await fetch(path)
let text = await data.text()
return text
} catch (err) {
return undefined
}
}