From 9f655116fb277ab17dd6b5572e944d0329ef4872 Mon Sep 17 00:00:00 2001 From: Kylart Date: Fri, 31 Mar 2017 15:04:16 +0200 Subject: [PATCH] Added watcher. --- src/watcher/watcher.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/watcher/watcher.js diff --git a/src/watcher/watcher.js b/src/watcher/watcher.js new file mode 100644 index 0000000..710be55 --- /dev/null +++ b/src/watcher/watcher.js @@ -0,0 +1,22 @@ +/** + * Created by Kylart on 30/03/2017. + */ + +const self = this + +const fs = require('fs') +const os = require('os') +const path = require('path') + +const ROOT_DIR = os.userInfo().homedir +const DIR = path.join(ROOT_DIR, '.KawAnime') + +const watchConf = (callback) => { + fs.watchFile(path.join(DIR, 'config.json'), (event) => { + console.log(event) + }) +} + +module.exports = { + watchConf +} \ No newline at end of file