From 9a9b8ba52fdde92794f61f471ecf4885516d05e1 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 4 Mar 2022 00:38:47 +0300 Subject: [PATCH] Update file.js --- scripts/core/file.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/core/file.js b/scripts/core/file.js index d191cc84..d3c7b384 100644 --- a/scripts/core/file.js +++ b/scripts/core/file.js @@ -48,6 +48,10 @@ file.write = function (filepath, data = '') { return fs.writeFile(path.resolve(filepath), data, { encoding: 'utf8' }).catch(console.error) } +file.writeSync = function (filepath, data = '') { + return fs.writeFileSync(path.resolve(filepath), data, { encoding: 'utf8' }) +} + file.clear = async function (filepath) { if (await file.exists(filepath)) return file.write(filepath, '') return true