Node's Package Magician

npm

Need private packages and team management tools?Check out npm Orgs. »

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).

install

npm i file-rename

Downloadsweekly downloads

3

version

1.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability