[Node.js]file-namer 文件重命名工具

昨晚写了个重命名工具,使用正则表达式匹配并替换文件名。

现在给npm包起个合适的名字是真难

GitHub: https://github.com/JiaJiaJiang/node-namer

效果

$ namer -f "/.+(?=\.txt$)/" -r "#COUNTERpoi$&"
match: /.+(?=\.txt$)/   find: /.+(?=\.txt$)/   replacement: #COUNTERpoi$&
Match list:
1.txt   >       1poi1.txt
2.txt   >       2poi2.txt
3.txt   >       3poi3.txt
4.txt   >       4poi4.txt
5.txt   >       5poi5.txt
6.txt   >       6poi6.txt
7.txt   >       7poi7.txt
8.txt   >       8poi8.txt
9.txt   >       9poi9.txt
10.txt  >       10poi10.txt
11.txt  >       11poi11.txt
12.txt  >       12poi12.txt
13.txt  >       13poi13.txt
14.txt  >       14poi14.txt
15.txt  >       15poi15.txt
16.txt  >       16poi16.txt
17.txt  >       17poi17.txt
18.txt  >       18poi18.txt
19.txt  >       19poi19.txt
20.txt  >       20poi20.txt
21.txt  >       21poi21.txt
22.txt  >       22poi22.txt
23.txt  >       23poi23.txt
24.txt  >       24poi24.txt
25.txt  >       25poi25.txt
26.txt  >       26poi26.txt
27.txt  >       27poi27.txt
28.txt  >       28poi28.txt
29.txt  >       29poi29.txt
30.txt  >       30poi30.txt
31.txt  >       31poi31.txt
32.txt  >       32poi32.txt
33.txt  >       33poi33.txt
34.txt  >       34poi34.txt
35.txt  >       35poi35.txt
36.txt  >       36poi36.txt


36matches found.
Confirm?    (control+c to exit)

Finished. 36succeeded,0failed

 



本文发布于 https://luojia.me

本站文章未经文下加注授权不得拷贝发布。

本博客使用Disqus评论系统,如果看不到评论框,请尝试爬墙。