summaryrefslogtreecommitdiff
path: root/public/gl/io
diff options
context:
space:
mode:
Diffstat (limited to 'public/gl/io')
-rw-r--r--public/gl/io/file.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/public/gl/io/file.js b/public/gl/io/file.js
new file mode 100644
index 0000000..f89565c
--- /dev/null
+++ b/public/gl/io/file.js
@@ -0,0 +1,11 @@
+export { readFileAsync }
+
+const readFileAsync = async (path) => {
+ try {
+ let data = await fetch(path)
+ let text = await data.text()
+ return text
+ } catch (err) {
+ return undefined
+ }
+} \ No newline at end of file