Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including rexname with all npm packages installed. Try it out:

rexname lists no main file and has no index.js, so it can't be directly required. If this is a mistake, please let us know. It may however contain internal files that you can require manually:

// require("rexname/[??]")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

rexname v0.1.2

Utility to rename files/folders using regular expressions.

rexname

NPM utility module to rename files using regular expressions.

Installation

Install globally via NPM

npm install -g rexname

Usage

rexname - **search**: a string or regular expression to match files on. e.g. `.txt` or `'/(.*)\.\d{4}/i'` (Use quotes when for special characters or spaces) - **replace**: a string used to replace file names. Use `$1 $2...` for matched text. e.g. `'new $1.$2'`

Example

filenames

file1_201208.txt
file2_201209.txt

rexname command

rexname '/file(\d+)_(\d{4})(\d{2}).txt/i' '$3-$2-module-$1.js'

result

2012-08-module-1.js
2012-09-module-2.js

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free