This commit is contained in:
Aleksandr Statciuk 2022-01-10 15:00:35 +03:00
parent b9ab8ee78e
commit ba6036dd7d
18 changed files with 105 additions and 740 deletions

View file

@ -48,8 +48,9 @@ file.write = function (filepath, data = '') {
return fs.writeFile(path.resolve(filepath), data, { encoding: 'utf8' }).catch(console.error)
}
file.clear = function (filepath) {
return file.write(filepath, '')
file.clear = async function (filepath) {
if (await file.exists(filepath)) return file.write(filepath, '')
return true
}
file.resolve = function (filepath) {