parent
							
								
									af4d9faf0f
								
							
						
					
					
						commit
						4c949fadd7
					
				|  | @ -1,3 +1,7 @@ | |||
| # 1.2.1 / 2020-01-02 | ||||
| * [F] 修复改回同步时回调未移除, 导致在node v12.10报错的bug  | ||||
| 
 | ||||
| 
 | ||||
| # 1.2.1 / 2019-08-06 | ||||
| * [U] 写操作改回同步 | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										18
									
								
								index.js
								
								
								
								
							
							
						
						
									
										18
									
								
								index.js
								
								
								
								
							|  | @ -9,12 +9,6 @@ | |||
| const FS = require('fs') | ||||
| const PATH = require('path') | ||||
| 
 | ||||
| const ERROR_FN = (err, res) => { | ||||
|   if (err) { | ||||
|     console.error(err) | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const Iofs = { | ||||
|   origin: FS, | ||||
| 
 | ||||
|  | @ -94,15 +88,15 @@ const Iofs = { | |||
|     } | ||||
| 
 | ||||
|     if (!!append) { | ||||
|       FS.appendFileSync(file, data, opt, ERROR_FN) | ||||
|       FS.appendFileSync(file, data, opt) | ||||
|     } else { | ||||
|       FS.writeFileSync(file, data, opt, ERROR_FN) | ||||
|       FS.writeFileSync(file, data, opt) | ||||
|     } | ||||
|   }, | ||||
| 
 | ||||
|   //修改权限
 | ||||
|   chmod(path, mode) { | ||||
|     FS.chmodSync(path, mode, ERROR_FN) | ||||
|     FS.chmodSync(path, mode) | ||||
|   }, | ||||
| 
 | ||||
|   /** | ||||
|  | @ -152,9 +146,9 @@ const Iofs = { | |||
|       list.forEach(it => { | ||||
|         this.rm(it, this.isdir(it)) | ||||
|       }) | ||||
|       FS.rmdirSync(origin, ERROR_FN) | ||||
|       FS.rmdirSync(origin) | ||||
|     } else { | ||||
|       FS.unlinkSync(origin, ERROR_FN) | ||||
|       FS.unlinkSync(origin) | ||||
|     } | ||||
|   }, | ||||
| 
 | ||||
|  | @ -196,7 +190,7 @@ const Iofs = { | |||
|       this.mkdir(updir) | ||||
|     } | ||||
| 
 | ||||
|     FS.mkdirSync(dir, ERROR_FN) | ||||
|     FS.mkdirSync(dir) | ||||
|   }, | ||||
| 
 | ||||
|   /** | ||||
|  |  | |||
							
								
								
									
										10
									
								
								package.json
								
								
								
								
							
							
						
						
									
										10
									
								
								package.json
								
								
								
								
							|  | @ -1,13 +1,19 @@ | |||
| { | ||||
|   "name": "iofs", | ||||
|   "version": "1.2.1", | ||||
|   "version": "1.2.2", | ||||
|   "description": "Base on native fs module, for easy using.", | ||||
|   "main": "index.js", | ||||
|   "repository": { | ||||
|     "type": "git", | ||||
|     "url": "https://github.com/yutent/iofs.git" | ||||
|   }, | ||||
|   "keywords": ["fivejs", "fs", "iofs", "fs.io", "file"], | ||||
|   "keywords": [ | ||||
|     "fivejs", | ||||
|     "fs", | ||||
|     "iofs", | ||||
|     "fs.io", | ||||
|     "file" | ||||
|   ], | ||||
|   "author": "yutent", | ||||
|   "license": "MIT" | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 宇天
						宇天