renamer-index-dir

2.0.1 • Public • Published

view on npm npm module downloads Gihub repo dependents Gihub package dependents Build Status Coverage Status js-standard-style

renamer-index-dir

This is a renamer replace chain plugin - see this tutorial to learn how to use renamer plugins.

Replaces the {{index}} token (like the built-in renamer behaviour) but resets the counter for each folder visited.

In the example below, Windows users should use double instead of single quotes. Remove the --dry-run flag to rename the files on disk.

$ npm install -g renamer renamer-index-dir

$ tree
.
├── folder1
│   ├── one
│   └── two
├── folder2
│   ├── one
│   └── two
├── one
└── two

2 directories, 6 files

$ renamer --chain find-replace --chain renamer-index-dir --find '/$/' --replace '{{index}}' --dry-run */*

✔︎ folder1/one → folder1/one1
✔︎ folder1/two → folder1/two2
✔︎ folder2/one → folder2/one1
✔︎ folder2/two → folder2/two2

$ tree
.
├── folder1
│   ├── one1
│   └── two2
├── folder2
│   ├── one1
│   └── two2
├── one
└── two

2 directories, 6 files

© 2018-21 Lloyd Brookes 75pound@gmail.com.

Package Sidebar

Install

npm i renamer-index-dir

Weekly Downloads

4

Version

2.0.1

License

MIT

Unpacked Size

5.4 kB

Total Files

4

Last publish

Collaborators

  • 75lb