Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/corentinth/bame
A cross-plateform tool to rename files batches using regex.
https://github.com/corentinth/bame
bulk cross-platform javascript npm rename
Last synced: 10 days ago
JSON representation
A cross-plateform tool to rename files batches using regex.
- Host: GitHub
- URL: https://github.com/corentinth/bame
- Owner: CorentinTh
- License: mit
- Created: 2019-12-03T19:45:52.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T02:47:57.000Z (almost 2 years ago)
- Last Synced: 2024-10-11T03:18:38.707Z (26 days ago)
- Topics: bulk, cross-platform, javascript, npm, rename
- Language: TypeScript
- Homepage:
- Size: 1.65 MB
- Stars: 17
- Watchers: 3
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
-------
![demo gif](.github/bame-demo.gif)
## Bame ?
The word **bame** come frome the portmenteau between *batch* and *rename*. **Bame** is a simple cross-plateform cli that'll help you rename several files at once.
## Usage
### Installation
**bame** can be installed using yarn or npm. It works for node version >= 8.```shell
npm install -g bame
# or
yarn global add bame
```### CLI
Simply run `bame` in the directory where the files you want to rename are located. Specify a regular expression with capturing groups (with parentesis) for the parts you want to keep while renaming. Then specify a string with the index of the capturing group you want to insert between braquets.
For example:
```shell
bame 'SerieName Episode (.*) Season (.*).mp4' 'SerieName - S{1}E{2}.mp4'
# SerieName Episode 1 Season 1.mp4 --> SerieName - S1E1.mp4
# SerieName Episode 2 Season 1.mp4 --> SerieName - S1E2.mp4
# SerieName Episode 3 Season 1.mp4 --> SerieName - S1E3.mp4
# SerieName Episode 4 Season 1.mp4 --> SerieName - S1E4.mp4
```Details and optional parameters:
```shell
Usage: bameOptions:
-d, --no-dir Should not rename directories [boolean]
-q, --quiet Rename silently [boolean]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]Examples:
bame "GoT Episode (.*) Season (.*)" "GOT.E{1}.S{2}"
```### API
You can also integarte **bame** in som code:```javascript
import { bame } from 'bame';bame({
inReg: 'GoT Episode (.*) Season (.*)',
outReg: 'GOT.E{1}.S{2}',
cwd: process.cwd(),
options:{
renameDir: true,
verbose: true
}
});
```## Contribute
**Pull requests are welcome !** Feel free to contribute.## Credits
Coded with ❤️ by [Corentin Thomasset](//corentin-thomasset.fr).The demonstartion gif has been generated using [Terminalizer](https://github.com/faressoft/terminalizer)
## License
This project is under the [MIT license](./LICENSE).