const fs = require('fs').promises; const ms = require('ms'); const os = require('os'); const path = require('path'); const getHooksRoot = () => path.join(os.homedir(), '/.syncthing-hooks'); const readHooksRoot = async root => { try { const files = await fs.readdir(root); return files; } catch { return []; } }; const parseHooks = (root, hooks) => hooks .map(x => ({ path: path.join(root, x), match: x.match(/(?.{11})-(?