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": {