From 5454950838f21fcc97ed8ce5f5d68529c0d6750f Mon Sep 17 00:00:00 2001 From: Jiiks Date: Sun, 24 Feb 2019 21:36:04 +0200 Subject: [PATCH] add writefile --- core/src/modules/utils.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/modules/utils.js b/core/src/modules/utils.js index d7e6262b..4dd062e2 100644 --- a/core/src/modules/utils.js +++ b/core/src/modules/utils.js @@ -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);