diff options
author | JoelHMikael <joel.h.kronqvist@gmail.com> | 2022-01-16 16:50:44 +0200 |
---|---|---|
committer | JoelHMikael <joel.h.kronqvist@gmail.com> | 2022-01-16 16:50:44 +0200 |
commit | 28e4f1cf0dbd1c14a9724d17cf9127d223d85289 (patch) | |
tree | 4daa0e811e580b1963ffb6b6cda04664b7d19245 /open.js | |
parent | 1a1b117cc9eae2cc2ecfb3695bebe21daf08741b (diff) | |
download | LYLLRuoka-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.js | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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; |