4.1.0 • Published 3 months ago
renamify v4.1.0
Renamify

Rename group of files from a directory.
Install
npm i renamify --save
API
import renamify from 'renamify';
const dir = '/';
const from = ['bin'];
const to = ['super-bin'];
await renamify(dir, from, to);
Full:
import renamify from 'renamify';
const dir = '/';
const from = ['/bin/hello'];
const to = ['/super-bin'];
await renamify(dir, from, to
Or with try-to-catch`:
import renamify from 'renamify';
import tryToCatch from 'try-to-catch';
const dir = '/';
const from = ['bin'];
const to = ['super-bin'];
const [error] = await tryToCatch(renamify, dir, from, to);
console.log(error || 'done');
Related
- renamify-cli - CLI rename group of files from a directory.
License
MIT