add writefile

This commit is contained in:
Jiiks 2019-02-24 21:36:04 +02:00
parent ed7abe3571
commit 5454950838
1 changed files with 9 additions and 0 deletions

View File

@ -99,6 +99,15 @@ export class FileUtils {
}
}
static async writeFile(path, data, options = {}) {
return new Promise((resolve, reject) => {
fs.writeFile(path, data, options, err => {
if (err) return reject(err);
resolve();
});
});
}
static async listDirectory(path) {
try {
await this.directoryExists(path);