file-rename

1.0.2 • Public • Published

file-rename

Batch modification of file names for specified folders

start

npm i file-rename

Use

const rename = require("./index");
 
// before
//
// ├── rename
// │   └── a
// │       ├── b
// │           └── b1.js
// │       └── a1.js
 
rename("./rename", ".js", ".jsx");
 
// after
//
// ├── rename
// │   └── a
// │       ├── b
// │           └── b1.jsx
// │       └── a1.jsx

option

  • folder
    • default: ./rename
    • type: string
    • describe: Catalogues to be processed.
  • match = ".js"
    • default: .js
    • type: string|RegExp
    • describe: Documents to be processed, Regular or string matching.
  • newName = ".ts"
    • default: .ts
    • type: string|function
    • describe: Names processed, Just like fileName.replace(match,newName).

Package Sidebar

Install

npm i file-rename

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

3.16 kB

Total Files

6

Last publish

Collaborators

  • wangtap