šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
DemoInstallSign in
Socket

renamer-index-dir

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

renamer-index-dir

Replaces the {{index}} token, resetting the counter for each folder visited.

2.0.1
latest
Source
npm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
Ā 
Created
Source

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.

Keywords

renamer-plugin

FAQs

Package last updated on 18 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts