Compare commits

..

21 Commits

Author SHA1 Message Date
yutent a986df0fa7 适配nodejs 14.14 2022-10-12 14:16:06 +08:00
宇天 bfbc829cd9 1.5.2 2020-12-15 18:16:27 +08:00
宇天 bf62ec06b9 merge 2020-12-15 18:15:19 +08:00
宇天 724e49c949 Merge branch 'master' of github.com:bytedo/iofs into master 2020-12-15 18:14:37 +08:00
宇天 901f356bfd 修复ls递归错误 2020-12-15 18:12:43 +08:00
宇天 11d37d5d9b 优化exists 2020-10-07 00:07:12 +08:00
宇天 de6182576d 增加is|isfile2个方法;exists方法改为调用is;优化stat方法返回 2020-09-21 16:57:40 +08:00
宇天 3b3c285d0c 1.4.0 2020-09-19 16:43:57 +08:00
宇天 37e44605a9 1.4.0 2020-09-19 16:43:18 +08:00
宇天 f43d707188 1.3.2 2020-01-18 18:53:36 +08:00
宇天 ec54db65d8 优化异常信息输出 2020-01-09 20:22:08 +08:00
宇天 5c66a1b883 更新文档 2020-01-09 11:44:26 +08:00
宇天 61dd8da228 更新文档 2020-01-09 11:06:32 +08:00
宇天 f44be49fbc 更新文档 2020-01-09 10:46:35 +08:00
宇天 5453b999be 一大波更新 2020-01-08 21:20:25 +08:00
宇天 4c949fadd7 修复改回同步时回调未移除, 导致在node v12.10报错的bug 2020-01-02 14:57:44 +08:00
宇天 af4d9faf0f 写操作改回同步 2019-08-06 17:37:41 +08:00
宇天 2222b0d005 1.2.0 2019-07-16 15:10:21 +08:00
宇天 d82c4e04b4 优化写操作 2019-07-16 15:03:53 +08:00
宇天 0c79c47b19 优化ls方法;增加错误信息输出;this.self改名为this.origin 2018-05-24 23:36:51 +08:00
宇天 81e0439161 delete the nouse log 2017-12-23 14:42:27 +08:00
5 changed files with 662 additions and 185 deletions

View File

@ -1,15 +0,0 @@
1.0.2 / 2017-11-20
* [fixed] Fixed remove the dir not empty call error.
1.0.1 / 2017-04-24
* [add] ls function can recur list child folder with second para set to be true.
1.0.0 / 2017-02-26
==================
* new project

227
Readme.md
View File

@ -1,120 +1,219 @@
![module info](https://nodei.co/npm/iofs.png?downloads=true&downloadRank=true&stars=true)
# iofs
> `iofs` is a bash-like module for reading and writing files on Node.js. It base on Node.js's native `fs` module.
## property
### self
> It return the native `fs` module for more requests.
> `iofs`是一个基于原生`fs`模块封装的工具, 旨在提供更加方便实用一些常用的API方法(同步), API习惯参考了`bash shell`, 习惯用命令行的朋友, 可能会比较亲切。
## API
+ props
- [origin](#origin)
+ methods
- [.cat(file)](#catfile)
- [.ls(path, recursive)](#lspath-recursive)
- [.echo(data, file, append, encode)](#echodata-file-append-encode)
- [.chmod(path, mode)](#chmodpath-mode)
- [.chown(path, uid, gid)](#chownpath-uid-gid)
- [.mv(origin, target)](#mvorigin-target)
- [.cp(origin, target)](#cporigin-target)
- [.rm(origin)](#rmorigin)
- [.stat(path)](#statpath)
- [.isdir(path)](#isdirpath)
- [.isfile(path)](#isfilepath)
- [.mkdir(dir, mode)](#mkdirdir-mode)
- [.exists(path)](#existspath)
- [.is(path)](#isspath-mode)
### cat(file)
- file `<String>`
> Just like bash's cat, it will read a file and return a Buffer.
## 属性
### origin
> 返回原生的`fs`模块对象, 方便调用一些未封装的额外功能
### ls(path, child)
- path `<String>`
- child `<Boolean>`
## APIs
> 所有API均支持在最后传入一个 `debug<Boolean>`参数(v1.3.2新增), 用于打印错误日志
> List all files and folders of the path given exclude '.' and '..'. I t return an array.
> If para `child` is set to be ture, it will recur list all files of child dir.
### .cat(file)
> 读取文件, 返回一个`Buffer对象`
| 参数 | 类型 | 是否必须 | 说明 |
| :--: | :--: | :--: | -- |
| file | `<String>` | 是 | 要读取的文件路径 |
---
### echo(data, file[, append][, encode])
- data `<String>` | `<Buffer>` | `<Number>`
- file `<String>`
- append `<Boolean>` optional
- encode `<String>` optional
### .ls(path, recursive)
> 列出指定目录下的所有文件&目录, 不包括 '.' and '..'. 结果返回一个数组.
| 参数 | 类型 | 是否必须 | 说明 |
| :--: | :--: | :--: | -- |
| path | `<String>` | 是 | 要读取的目录 |
| recursive | `<String>` | 否 | 是否递归读取 |
---
### .echo(data, file, append, encode)
> 写数据到指定文件中. 如果指定文件不存在, 则自动生成.
| 参数 | 类型 | 是否必须 | 说明 |
| :--: | :--: | :--: | -- |
| data | `<String>` `<Buffer>` `<Number>` | 是 | 要写入的数据, 可以字符串、Buffer对象, 数字 |
| file | `<String>` | 是 | 要写入的文件名, 不存在会自动创建, 如存在会覆盖 |
| append | `<Boolean>` | 否 | 是否在文件后追加数据, 默认否, 即会整个文件替换 |
| encode | `<String>` | 否 | 指定保存的编码, 默认utf8 |
> Write/Append data to a file. creating the file if it does not yet exist.
> If `append` is set true, it will append data to the file.
> Default `encode` is utf8.
```javascript
let fs = require('iofs')
var fs = require('iofs')
fs.echo('hello ', 'test.txt') // replacing test.txt if it exists.
fs.echo('world', 'test.txt', true) // append the data to test.txt
fs.echo('hello ', 'test.txt') // 如果test.txt存在, 则覆盖.
fs.echo('world', 'test.txt', true) // 不会覆盖, 只会追加到 test.txt中
```
---
### .chmod(path, mode)
> 修改文件&目录的权限.
### chmod(file, mode)
- file `<String>` | `<Buffer>`
- mode `<Integer>`
| 参数 | 类型 | 是否必须 | 说明 |
| :--: | :--: | :--: | -- |
| path | `<String>`| 是 | 要修改的文件&目录路径 |
| mode | `<Number>` | 是 | 权限码 `0o000 - 0o777` |
> Changes the mode of the file specified whose pathname is given.
```javascript
fs.chmod('test.txt', 777) // replacing test.txt if it exists.
fs.chmod('test.txt', 0o777)
```
---
### mv(from, to)
- from `<String>`
- to `<String>`
> Move a fil to the target location. It can also use to renaming a file.
### .chown(path, uid, gid)
> 修改文件&目录的归属。
>> `v1.3.0 新增`
| 参数 | 类型 | 是否必须 | 说明 |
| :--: | :--: | :--: | -- |
| path | `<String>`| 是 | 要修改的文件&目录路径 |
| uid | `<Number>` | 是 | 用户ID |
| gid | `<Number>` | 是 | 用户组ID |
### cp(from, to)
- from `<String>`
- to `<String>`
> Copy a fil to the target location.
---
### rm(path, recursion)
- path `<String>`
- recursion `<Boolean>`
> Delete a file or a folder. If path is a folder, `recursion` must be set to true.
### .mv(origin, target)
> 移动文件&目录, 支持跨磁盘移动; 同时具备重命名功能。
>> `v1.3.0 之后支持对目录进行操作`
| 参数 | 类型 | 是否必须 | 说明 |
| :--: | :--: | :--: | -- |
| origin | `<String>`| 是 | 要移动或重命名的文件&目录 |
| target | `<String>` | 是 | 目标文件名&目录名 |
---
### .cp(origin, target)
> 复制文件&目录, 支持跨磁盘复制。
>> `v1.3.0 之后支持对目录进行操作`
| 参数 | 类型 | 是否必须 | 说明 |
| :--: | :--: | :--: | -- |
| origin | `<String>`| 是 | 要复制的文件&目录 |
| target | `<String>` | 是 | 目标文件名&目录名 |
---
### .rm(origin)
> 删除文件&目录
>> `v1.3.0 之后取消第2个参数, 改为自动判断是否目录, 是否自动递归删除`
| 参数 | 类型 | 是否必须 | 说明 |
| :--: | :--: | :--: | -- |
| origin | `<String>`| 是 | 要删除的文件&目录 |
```javascript
fs.rm('./foo/test.txt')
fs.rm('./foo', true)
fs.rm('./foo') // 整个目录删除
```
### stat(path)
- path `<String>`
> Returns an instance of fs.Stats.
### isdir(path)
- path `<String>`
> Return true if the path is a folder, and false when it is a file or not yet exists.
---
### mkdir(path)
- path `<String>`
### .stat(path)
> 返回文件&目录的状态信息, 如修改时间, 文件大小等
> Build a folder in where you want.
| 参数 | 类型 | 是否必须 | 说明 |
| :--: | :--: | :--: | -- |
| path | `<String>`| 是 | 要读取的目录&文件 |
### exists(path)
- path `<String>`
> Return true if the path exists, and false not.
---
### .isdir(path)
> 判断指定目录是否为一个目录, 路径不存在或者不是目录都会返回 false.
| 参数 | 类型 | 是否必须 | 说明 |
| :--: | :--: | :--: | -- |
| path | `<String>`| 是 | 要读取的目录路径 |
---
### .isfile(path)
> 判断指定目录是否为一个文件, 路径不存在或者不是文件都会返回 false
| 参数 | 类型 | 是否必须 | 说明 |
| :--: | :--: | :--: | -- |
| path | `<String>`| 是 | 要读取的文件 |
---
### .mkdir(dir)
> 创建目录, 会自动创建上级目录(如不存在)
| 参数 | 类型 | 是否必须 | 说明 |
| :--: | :--: | :--: | -- |
| dir | `<String>`| 是 | 要创建的目录名 |
---
### .exists(path)
> 判断文件&目录是否存在
| 参数 | 类型 | 是否必须 | 说明 |
| :--: | :--: | :--: | -- |
| path | `<String>`| 是 | 要读取的目录&文件 |
---
### .is(path, mode)
> 判断文件&目录是否存在
| 参数 | 类型 | 是否必须 | 说明 |
| :--: | :--: | :--: | -- |
| path | `<String>`| 是 | 要读取的目录&文件 |
| mode | `<Number>`| 否 | 如 r: 4, w: 2, rw: 6 |

287
index.js
View File

@ -1,63 +1,75 @@
/**
*
* @authors yutent (yutent@doui.cc)
* @date 2015-12-28 14:28:38
*
* @author yutent<yutent.io@gmail.com>
* @date 2020/09/19 16:39:59
*/
'use strict'
const fs = require('fs'),
path = require('path')
const FS = require('fs')
const PATH = require('path')
class Iofs {
constructor() {
this.self = fs
class Stats {
isFile() {
return false
}
isDirectory() {
return false
}
isSocket() {
return false
}
isSymbolicLink() {
return false
}
}
const VERSION = +process.versions.node.split('.').slice(0, 2).join('.')
const EMPTY_STAT = new Stats()
const Iofs = {
origin: FS,
/**
* [cat 文件读取]
* @param {String} file [文件路径]
* @param {Function} cb [回调] 可选
*/
cat(file) {
cat(file, debug) {
try {
return fs.readFileSync(file)
return FS.readFileSync(file)
} catch (err) {
console.error(err)
debug && console.error('call cat(): ', err + '')
return null
}
}
},
/**
* [ls 读取整个目录(不遍历子目录)]
* @param {string} dir [目标路径]
* @param {boolean} child [是否遍历子目录]
* @param {boolean} recursive [是否递归遍历子目录]
* @return {array} [返回目标目录所有文件名和子目录名, 不包括'.''..']
*/
ls(dir, child) {
ls(dir, recursive, debug) {
try {
let list = fs.readdirSync(dir)
var list = FS.readdirSync(dir)
if (!child) return list
let tmp = Array.from(list)
tmp.forEach(it => {
let childdir = path.join(dir, it)
if (this.isdir(childdir)) {
list = Array.prototype.concat.apply(
list,
this.ls(childdir, true).map(sub => {
return path.join(it, sub)
})
)
}
list.forEach((it, i) => {
list[i] = PATH.resolve(dir, it)
})
if (recursive) {
var tmp = list.concat()
tmp.forEach(it => {
if (this.isdir(it)) {
list = list.concat(this.ls(it, recursive))
}
})
}
return list
} catch (err) {
console.error(err)
debug && console.error('call ls(): ', err + '')
return null
}
}
},
/**
* [echo 写文件]
@ -66,13 +78,13 @@ class Iofs {
* @param {Boolean} append [是否在后面追加默认否]
* @param {String} encode [编码, 默认utf8]
*/
echo(data, file, append, encode) {
echo(data, file, append, encode, debug) {
if (!file) {
return data
}
let updir = path.parse(file).dir,
opt = {}
var updir = PATH.parse(file).dir
var opt = {}
if (!this.isdir(updir)) {
this.mkdir(updir)
}
@ -89,92 +101,134 @@ class Iofs {
try {
if (!!append) {
fs.appendFileSync(file, data, opt)
FS.appendFileSync(file, data, opt)
} else {
fs.writeFileSync(file, data, opt)
FS.writeFileSync(file, data, opt)
}
return true
} catch (err) {
console.error(err)
debug && console.error('call echo(): ', err + '')
return false
}
}
},
//修改权限
chmod(path, mode) {
chmod(path, mode, debug) {
try {
fs.chmodSync(path, mode)
FS.chmodSync(path, mode)
return true
} catch (err) {
console.error(err)
debug && console.error('call chmod(): ', err + '')
return false
}
}
},
//修改所属用户
chown(path, uid, gid, debug) {
try {
FS.chownSync(path, uid, gid)
return true
} catch (err) {
debug && console.error('call chown(): ', err + '')
return false
}
},
/**
* [mv 移动文件,兼具重命名功能]
* @param {String} from [原路径/原名]
* @param {String} to [目标路径/新名]
* [mv 移动文件&目录,兼具重命名功能]
* @param {String} origin [原路径/原名]
* @param {String} target [目标路径/新名]
*/
mv(from, to) {
let updir = path.parse(to).dir
if (!this.isdir(updir)) this.mkdir(updir)
try {
fs.renameSync(from, to)
} catch (e) {
let rs = fs.createReadStream(from),
ws = fs.createWriteStream(to)
rs.pipe(ws)
rs.on('end', err => {
this.rm(from)
})
}
}
cp(from, to) {
let updir = path.parse(to).dir
mv(origin, target, debug) {
var updir = PATH.parse(target).dir
if (!this.isdir(updir)) {
this.mkdir(updir)
}
let rs = fs.createReadStream(from),
ws = fs.createWriteStream(to)
try {
FS.renameSync(origin, target)
} catch (err) {
if (~err.message.indexOf('cross-device')) {
if (this.cp(origin, target)) {
return this.rm(origin)
}
return false
}
debug && console.error('call mv(): ', err + '')
return false
}
},
rs.pipe(ws)
rs.on('end', err => console.error(err))
}
/**
* [cp 复制文件&目录]
* @param {String} origin [原路径]
* @param {String} target [目标路径]
*/
cp(origin, target, debug) {
try {
// 如果是目录, 则递归操作
if (this.isdir(origin)) {
this.mkdir(target)
var list = this.ls(origin)
list.forEach(val => {
let name = PATH.parse(val).base
this.cp(val, PATH.join(target, name))
})
} else {
var updir = PATH.parse(target).dir
if (!this.isdir(updir)) {
this.mkdir(updir)
}
var rs = FS.createReadStream(origin)
var ws = FS.createWriteStream(target)
rs.pipe(ws)
}
return true
} catch (err) {
debug && console.error('call cp(): ', err + '')
return false
}
},
/**
* [rm 删除文件/目录]
* @param {[type]} from [源文件/目录路径]
* @param {[type]} recursion [是否递归删除若删除目录此值须为true]
* @param {[type]} origin [源文件/目录路径]
*/
rm(from, recursion) {
rm(origin, debug) {
try {
if (!!recursion) {
let list = this.ls(from)
list.forEach(it => {
it = path.resolve(from, it)
this.rm(it, this.isdir(it))
})
fs.rmdirSync(from)
if (VERSION >= 14.14) {
FS.rmSync(origin, { recursive: true })
} else {
fs.unlinkSync(from)
if (this.isdir(origin)) {
var list = this.ls(origin)
list.forEach(it => this.rm(it))
FS.rmdirSync(origin)
} else {
FS.unlinkSync(origin)
}
}
return true
} catch (err) {
console.error(err)
debug && console.error('call rm(): ', err + '')
return false
}
}
},
/**
* [stat 返回文件/目录的状态信息]
* @param {[type]} path [目标路径]
* @param {[string]} path [目标路径]
* @param {[boolean]} debug [是否静默检测, 是否不打印错误日志]
*/
stat(path) {
stat(path, debug) {
try {
return fs.statSync(path)
return FS.statSync(path)
} catch (err) {
return null
debug && console.error('call stat(): ', err + '')
return EMPTY_STAT
}
}
},
/**
* [isdir 判断目标是否为目录]
@ -186,34 +240,63 @@ class Iofs {
} catch (err) {
return false
}
}
},
isfile(path) {
try {
return this.stat(path).isFile()
} catch (err) {
return false
}
},
/**
* [mkdir 新建目录]
* @param {String} dir [目标路径]
* @param {Number} mode [目录权限, node v10.12起支持]
*/
mkdir(dir) {
let updir = path.parse(dir).dir
if (!updir) return
if (!this.isdir(updir)) {
this.mkdir(updir)
}
mkdir(dir, mode = 0o755, debug) {
try {
fs.mkdirSync(dir)
if (VERSION > 10.12) {
FS.mkdirSync(dir, { recursive: true, mode: mode })
} else {
var updir = PATH.parse(dir).dir
if (!updir) {
debug && console.error('call mkdir(): ', 'Wrong dir path')
return false
}
if (!this.isdir(updir)) {
this.mkdir(updir)
}
FS.mkdirSync(dir)
this.chmod(dir, mode)
}
return true
} catch (err) {
console.error(err)
debug && console.error('call mkdir(): ', err + '')
return false
}
}
},
/**
* [exists 判断目标(文件/目录)是否存在]
* @param {String} file [目标路径]
*/
exists(file) {
return fs.existsSync(file)
return this.is(file, FS.constants.F_OK)
},
// 是否可读写
is(file, mode) {
try {
FS.accessSync(file, mode)
return true
} catch (e) {
return false
}
}
}
module.exports = new Iofs()
module.exports = Iofs

300
index.mjs Normal file
View File

@ -0,0 +1,300 @@
/**
* @author yutent<yutent.io@gmail.com>
* @date 2020/09/19 16:39:59
*/
import FS from 'fs'
import PATH from 'path'
class STATS {
isFile() {
return false
}
isDirectory() {
return false
}
isSocket() {
return false
}
isSymbolicLink() {
return false
}
}
const VERSION = +process.versions.node.split('.').slice(0, 2).join('.')
const EMPTY_STAT = new STATS()
export default {
origin: FS,
/**
* [cat 文件读取]
* @param {String} file [文件路径]
* @param {Function} cb [回调] 可选
*/
cat(file, debug) {
try {
return FS.readFileSync(file)
} catch (err) {
debug && console.error('call cat(): ', err + '')
return null
}
},
/**
* [ls 读取整个目录(不遍历子目录)]
* @param {string} dir [目标路径]
* @param {boolean} recursive [是否递归遍历子目录]
* @return {array} [返回目标目录所有文件名和子目录名, 不包括'.''..']
*/
ls(dir, recursive, debug) {
try {
var list = FS.readdirSync(dir)
list.forEach((it, i) => {
list[i] = PATH.resolve(dir, it)
})
if (recursive) {
var tmp = list.concat()
tmp.forEach(it => {
if (this.isdir(it)) {
list = list.concat(this.ls(it, recursive))
}
})
}
return list
} catch (err) {
debug && console.error('call ls(): ', err + '')
return null
}
},
/**
* [echo 写文件]
* @param {String|Buffer|Number} data [要写入的数据]
* @param {String} file [要写的文件]
* @param {Boolean} append [是否在后面追加默认否]
* @param {String} encode [编码, 默认utf8]
*/
echo(data, file, append, encode, debug) {
if (!file) {
return data
}
var updir = PATH.parse(file).dir
var opt = {}
if (!this.isdir(updir)) {
this.mkdir(updir)
}
if (append && typeof append === 'string') {
encode = append
append = false
opt.encoding = encode
} else {
if (typeof encode === 'string') {
opt.encoding = encode
}
}
try {
if (!!append) {
FS.appendFileSync(file, data, opt)
} else {
FS.writeFileSync(file, data, opt)
}
return true
} catch (err) {
debug && console.error('call echo(): ', err + '')
return false
}
},
//修改权限
chmod(path, mode, debug) {
try {
FS.chmodSync(path, mode)
return true
} catch (err) {
debug && console.error('call chmod(): ', err + '')
return false
}
},
//修改所属用户
chown(path, uid, gid, debug) {
try {
FS.chownSync(path, uid, gid)
return true
} catch (err) {
debug && console.error('call chown(): ', err + '')
return false
}
},
/**
* [mv 移动文件&目录,兼具重命名功能]
* @param {String} origin [原路径/原名]
* @param {String} target [目标路径/新名]
*/
mv(origin, target, debug) {
var updir = PATH.parse(target).dir
if (!this.isdir(updir)) {
this.mkdir(updir)
}
try {
FS.renameSync(origin, target)
} catch (err) {
if (~err.message.indexOf('cross-device')) {
if (this.cp(origin, target)) {
return this.rm(origin)
}
return false
}
debug && console.error('call mv(): ', err + '')
return false
}
},
/**
* [cp 复制文件&目录]
* @param {String} origin [原路径]
* @param {String} target [目标路径]
*/
cp(origin, target, debug) {
try {
// 如果是目录, 则递归操作
if (this.isdir(origin)) {
this.mkdir(target)
var list = this.ls(origin)
list.forEach(val => {
let name = PATH.parse(val).base
this.cp(val, PATH.join(target, name))
})
} else {
var updir = PATH.parse(target).dir
if (!this.isdir(updir)) {
this.mkdir(updir)
}
var rs = FS.createReadStream(origin)
var ws = FS.createWriteStream(target)
rs.pipe(ws)
}
return true
} catch (err) {
debug && console.error('call cp(): ', err + '')
return false
}
},
/**
* [rm 删除文件/目录]
* @param {[type]} origin [源文件/目录路径]
*/
rm(origin, debug) {
try {
if (VERSION >= 14.14) {
FS.rmSync(origin, { recursive: true })
} else {
if (this.isdir(origin)) {
var list = this.ls(origin)
list.forEach(it => this.rm(it))
FS.rmdirSync(origin)
} else {
FS.unlinkSync(origin)
}
}
return true
} catch (err) {
debug && console.error('call rm(): ', err + '')
return false
}
},
/**
* [stat 返回文件/目录的状态信息]
* @param {[string]} path [目标路径]
* @param {[boolean]} debug [是否静默检测, 是否不打印错误日志]
*/
stat(path, debug) {
try {
return FS.statSync(path)
} catch (err) {
debug && console.error('call stat(): ', err + '')
return EMPTY_STAT
}
},
/**
* [isdir 判断目标是否为目录]
* @param {String} path [目标路径]
*/
isdir(path) {
try {
return this.stat(path).isDirectory()
} catch (err) {
return false
}
},
isfile(path) {
try {
return this.stat(path).isFile()
} catch (err) {
return false
}
},
/**
* [mkdir 新建目录]
* @param {String} dir [目标路径]
* @param {Number} mode [目录权限, node v10.12起支持]
*/
mkdir(dir, mode = 0o755, debug) {
try {
if (VERSION > 10.12) {
FS.mkdirSync(dir, { recursive: true, mode: mode })
} else {
var updir = PATH.parse(dir).dir
if (!updir) {
debug && console.error('call mkdir(): ', 'Wrong dir path')
return false
}
if (!this.isdir(updir)) {
this.mkdir(updir)
}
FS.mkdirSync(dir)
this.chmod(dir, mode)
}
return true
} catch (err) {
debug && console.error('call mkdir(): ', err + '')
return false
}
},
/**
* [exists 判断目标(文件/目录)是否存在]
* @param {String} file [目标路径]
*/
exists(file) {
return this.is(file, FS.constants.F_OK)
},
// 是否可读写
is(file, mode) {
try {
FS.accessSync(file, mode)
return true
} catch (e) {
return false
}
}
}

View File

@ -1,13 +1,23 @@
{
"name": "iofs",
"version": "1.0.2",
"description": "Base on native fs module, for easy using.",
"version": "1.5.3",
"description": "iofs是一个基于原生fs模块封装的工具, 旨在提供更加方便实用一些常用的API方法(同步), API习惯参考了bash shell。",
"main": "index.js",
"exports": {
"require": "./index.js",
"import": "./index.mjs"
},
"repository": {
"type": "git",
"url": "https://github.com/yutent/iofs.git"
"url": "https://github.com/bytedo/iofs.git"
},
"keywords": ["dojs", "fs", "iofs", "fs.io", "file"],
"keywords": [
"fivejs",
"fs",
"iofs",
"fs.io",
"file"
],
"author": "yutent",
"license": "MIT"
}