mirror of
https://github.com/iptv-org/epg
synced 2025-12-17 10:56:57 -05:00
Update file.js
This commit is contained in:
@@ -48,6 +48,10 @@ file.write = function (filepath, data = '') {
|
|||||||
return fs.writeFile(path.resolve(filepath), data, { encoding: 'utf8' }).catch(console.error)
|
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) {
|
file.clear = async function (filepath) {
|
||||||
if (await file.exists(filepath)) return file.write(filepath, '')
|
if (await file.exists(filepath)) return file.write(filepath, '')
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user