1.0.0 • Published 7 years ago

mass-file-renamer v1.0.0

Weekly downloads
7
License
MIT
Repository
github
Last release
7 years ago

mass-file-renamer

package version package downloads standard-readme compliant package license make a pull request

Rename files in directory recursively

Table of Contents

Install

This project uses node and npm.

$ npm install mass-file-renamer
$ # OR
$ yarn add mass-file-renamer

Usage

const massFileRenamer = require('mass-file-renamer')

massFileRenamer({
  dir: 'test-files',
  ignore: ['.DS_Store'],
  renamer: (dirname = '', oldName = '') => {
    const newName = `foo-${oldName.toUpperCase()}`
    console.log(dirname, oldName, newName)
    return newName // Return new name for file
  }
})
  .then(() => {
    console.log('Done')
  })
  .catch(console.error)

Contribute

  1. Fork it and create your feature branch: git checkout -b my-new-feature
  2. Commit your changes: git commit -am 'Add some feature'
  3. Push to the branch: git push origin my-new-feature
  4. Submit a pull request

License

MIT