3.1.4 • Published 5 years ago

fie-fs v3.1.4

Weekly downloads
76
License
-
Repository
github
Last release
5 years ago

fie-fs

NPM version David deps Known Vulnerabilities npm download

fie 文件及文件夹操作模块,一般用于套件中的模板生成及变量替换

安装

npm install fie-fs --save

API

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 模板引擎, 标签开始和结束符是: <{% %}>

rewriteFile(options)

重写文件内容, 本文件不提供读写文件能力,

  • options object
  • options.hook string 判断需要插入行的标记
  • options.insertLines array 数组类型, 每一项为新行
  • options.place string before / after(默认)
  • options.noMatchActive string top / bottom / null(默认)

move(srcPath, distPath)

移动文件

  • srcPath string 源文件,绝对路径
  • distPath string 目标文件,绝对路径

remove(file)

删除文件或目录

  • file string 需要删除的文件路径

Support

使用过程中遇到的相关问题,及BUG反馈,可联系: hugohua baofen14787@gmail.com ,也可直接提issues

License

GNU GPLv3

3.1.8-alpha.0

5 years ago

3.1.4

5 years ago

3.1.3

6 years ago

3.1.3-0

6 years ago

3.1.2

6 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.7.10

7 years ago

2.7.9

7 years ago

2.7.8

7 years ago

2.7.7

7 years ago

2.7.4

7 years ago

2.7.3

7 years ago

1.3.7

7 years ago

1.3.5

7 years ago

1.3.4

7 years ago

1.3.3

7 years ago

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.1.0

7 years ago