3.1.4 • Published 7 years ago
fie-fs v3.1.4
fie-fs
fie 文件及文件夹操作模块,一般用于套件中的模板生成及变量替换
安装
npm install fie-fs --saveAPI
copyDirectory(options)
复制目录, 支持 underscore 模板引擎, 标签开始和结束符是: <{% %}>
- options
object - options.src
string绝对路径 - options.dist
string绝对路径 - options.data
string需要替换变量的数据 - options.ignore
array数组, 类似 gitignore 的写法 - options.templateSettings
object, 默认是 { evaluate: /<{%(\s\S+?)%}>/g, interpolate: /<{%=(\s\S+?)%}>/g, escape: /<{%-(\s\S+?)%}>/g }
copyTpl(options)
复制文件, 支持 underscore 模板引擎, 标签开始和结束符是: <{% %}>
- options
object - options.src
string绝对路径 - options.dist
string绝对路径 - options.data
object需要替换变量的数据 - options.stringReplace 数组 , 将文件里面匹配到的字符串替换掉,如 { placeholder: 'PLACEHOLDER', value: 'theReplaceValue' }
rewriteFile(options)
重写文件内容, 本文件不提供读写文件能力,
- options
object - options.hook
string判断需要插入行的标记 - options.insertLines
array数组类型, 每一项为新行 - options.place
stringbefore / after(默认) - options.noMatchActive
stringtop / bottom / null(默认)
move(srcPath, distPath)
移动文件
- srcPath
string源文件,绝对路径 - distPath
string目标文件,绝对路径
remove(file)
删除文件或目录
- file
string需要删除的文件路径
Support
使用过程中遇到的相关问题,及BUG反馈,可联系: hugohua baofen14787@gmail.com ,也可直接提issues
License
3.1.8-alpha.0
7 years ago
3.1.4
7 years ago
3.1.3
7 years ago
3.1.3-0
8 years ago
3.1.2
8 years ago
3.0.1
8 years ago
3.0.0
8 years ago
2.7.10
8 years ago
2.7.9
8 years ago
2.7.8
9 years ago
2.7.7
9 years ago
2.7.4
9 years ago
2.7.3
9 years ago
1.3.7
9 years ago
1.3.5
9 years ago
1.3.4
9 years ago
1.3.3
9 years ago
1.3.2
9 years ago
1.3.1
9 years ago
1.3.0
9 years ago
1.1.0
9 years ago