Skip to content

eclipticrick/batch-file-renamer

Repository files navigation

Batch file renamer

For renaming multiple files and/or sub-folders at once in a folder

Build Status Coverage Status GitHub

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

You need:

  • NodeJS and NPM to install the dependencies for this project (recommended NodeJS version 8 or higher)

Installing

A step by step series of examples that tell you how to get a development env running

Clone the repo.

git clone https://github.com/eclipticrick/batch-file-renamer.git batch-file-renamer

Install the dependencies in the newly created folder

cd batch-file-renamer
npm install

Usage

(Optionally) Configure the defaults or add custom actions in config.js

module.exports = {
    default: {
        path: 'C:\\Temp',
        renameFolders: false,
        renameFiles: true
    },
    actions: {
        replace: {
            fn: oldName => (replaceString, withString) => {
                const re = new RegExp(replaceString, 'g');
                return oldName.replace(re, withString);
            },
            args: ['string to replace', 'replacement string']
        },
        reverse: {
            fn: oldName => () => oldName.split('').reverse().join(''),
            args: []
        },
        toUpperCase: {
            fn: oldName => () => oldName.toUpperCase(),
            args: []
        },
        append:  {
            fn: oldName => string => oldName + string,
            args: ['string to append']
        }
    }
};

Run the program to rename files & folders

npm run start

Example GIF

Authors

See also the list of contributors who participated in this project.

About

For renaming multiple files at once in a folder

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published