写操作改回同步

master 1.2.1
宇天 2019-08-06 17:37:41 +08:00
parent 2222b0d005
commit af4d9faf0f
3 changed files with 10 additions and 7 deletions

View File

@ -1,3 +1,6 @@
# 1.2.1 / 2019-08-06
* [U] 写操作改回同步
# 1.2.0 / 2019-07-16 # 1.2.0 / 2019-07-16
* [U] 优化结构 * [U] 优化结构
* [U] 部分写操作改为异步 * [U] 部分写操作改为异步

View File

@ -94,15 +94,15 @@ const Iofs = {
} }
if (!!append) { if (!!append) {
FS.appendFile(file, data, opt, ERROR_FN) FS.appendFileSync(file, data, opt, ERROR_FN)
} else { } else {
FS.writeFile(file, data, opt, ERROR_FN) FS.writeFileSync(file, data, opt, ERROR_FN)
} }
}, },
//修改权限 //修改权限
chmod(path, mode) { chmod(path, mode) {
FS.chmod(path, mode, ERROR_FN) FS.chmodSync(path, mode, ERROR_FN)
}, },
/** /**
@ -152,9 +152,9 @@ const Iofs = {
list.forEach(it => { list.forEach(it => {
this.rm(it, this.isdir(it)) this.rm(it, this.isdir(it))
}) })
FS.rmdir(origin, ERROR_FN) FS.rmdirSync(origin, ERROR_FN)
} else { } else {
FS.unlink(origin, ERROR_FN) FS.unlinkSync(origin, ERROR_FN)
} }
}, },
@ -196,7 +196,7 @@ const Iofs = {
this.mkdir(updir) this.mkdir(updir)
} }
FS.mkdir(dir, ERROR_FN) FS.mkdirSync(dir, ERROR_FN)
}, },
/** /**

View File

@ -1,6 +1,6 @@
{ {
"name": "iofs", "name": "iofs",
"version": "1.2.0", "version": "1.2.1",
"description": "Base on native fs module, for easy using.", "description": "Base on native fs module, for easy using.",
"main": "index.js", "main": "index.js",
"repository": { "repository": {