1.0.2 • Published 5 years ago

nodejs-string-batch-replace-script v1.0.2

Weekly downloads
4
License
GPL-3.0
Repository
github
Last release
5 years ago

nodejs-string-batch-replace-script

一个用Node.js写的轻量级批量替换文件中字符的脚本。

可用于批量替换Hexo文章中的url等

使用方法

1.获取脚本

npm 方式:

npm i nodejs-string-batch-replace-script

Git 方式:

git clone git@github.com:WeicMa/nodejs-string-batch-replace-script.git && cd nodejs-string-batch-replace-script

2.修改config.js配置文件

module.exports = {
    postPath: '',           // 文件目录的路径,例 F:\\Hexo\\source\\_posts 或 /homm/wwwroot/hexo/source/_posts
    oldStr: '',     // 旧字符串
    newStr: ''     // 新字符串
}

3.执行脚本

node index

4.查看执行结果。。。