webgl/public/gl/io/File.js

11 lines
219 B
JavaScript
Raw Normal View History

2023-01-19 18:39:40 +00:00
export const File = {}
2023-01-18 14:30:41 +00:00
2023-01-19 18:39:40 +00:00
File.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
}
}