aboutsummaryrefslogtreecommitdiff
path: root/open.js
diff options
context:
space:
mode:
authorJoelHMikael <joel.h.kronqvist@gmail.com>2022-01-16 16:50:44 +0200
committerJoelHMikael <joel.h.kronqvist@gmail.com>2022-01-16 16:50:44 +0200
commit28e4f1cf0dbd1c14a9724d17cf9127d223d85289 (patch)
tree4daa0e811e580b1963ffb6b6cda04664b7d19245 /open.js
parent1a1b117cc9eae2cc2ecfb3695bebe21daf08741b (diff)
downloadLYLLRuoka-28e4f1cf0dbd1c14a9724d17cf9127d223d85289.tar.gz
LYLLRuoka-28e4f1cf0dbd1c14a9724d17cf9127d223d85289.zip
Actual class parsing
Really messy, feel free to improve, or even rewrite.
Diffstat (limited to 'open.js')
-rw-r--r--open.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/open.js b/open.js
new file mode 100644
index 0000000..f04201b
--- /dev/null
+++ b/open.js
@@ -0,0 +1,16 @@
+const fs = require("fs");
+
+function openFile(path)
+{
+ return new Promise((resolve, reject) =>
+ {
+ fs.readFile(path, (err, data) =>
+ {
+ if (err)
+ reject(err);
+ resolve(data);
+ })
+ });
+}
+
+exports.file = openFile;