From af4d9faf0f6a6f7e587d554fcf47ae35be5a054b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Tue, 6 Aug 2019 17:37:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=99=E6=93=8D=E4=BD=9C=E6=94=B9=E5=9B=9E?= =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- History.md | 3 +++ index.js | 12 ++++++------ package.json | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/History.md b/History.md index 1c02bcd..c2df364 100644 --- a/History.md +++ b/History.md @@ -1,3 +1,6 @@ +# 1.2.1 / 2019-08-06 +* [U] 写操作改回同步 + # 1.2.0 / 2019-07-16 * [U] 优化结构 * [U] 部分写操作改为异步 diff --git a/index.js b/index.js index 393b08c..aede7f6 100644 --- a/index.js +++ b/index.js @@ -94,15 +94,15 @@ const Iofs = { } if (!!append) { - FS.appendFile(file, data, opt, ERROR_FN) + FS.appendFileSync(file, data, opt, ERROR_FN) } else { - FS.writeFile(file, data, opt, ERROR_FN) + FS.writeFileSync(file, data, opt, ERROR_FN) } }, //修改权限 chmod(path, mode) { - FS.chmod(path, mode, ERROR_FN) + FS.chmodSync(path, mode, ERROR_FN) }, /** @@ -152,9 +152,9 @@ const Iofs = { list.forEach(it => { this.rm(it, this.isdir(it)) }) - FS.rmdir(origin, ERROR_FN) + FS.rmdirSync(origin, ERROR_FN) } else { - FS.unlink(origin, ERROR_FN) + FS.unlinkSync(origin, ERROR_FN) } }, @@ -196,7 +196,7 @@ const Iofs = { this.mkdir(updir) } - FS.mkdir(dir, ERROR_FN) + FS.mkdirSync(dir, ERROR_FN) }, /** diff --git a/package.json b/package.json index 071e473..65eedd7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iofs", - "version": "1.2.0", + "version": "1.2.1", "description": "Base on native fs module, for easy using.", "main": "index.js", "repository": {