Rename group of files from a directory.
npm i renamify --save
renamify
can be used as a promise
:
const renamify = require('renamify');
const dir = '/';
const from = [
'bin'
];
const to = [
'super-bin'
];
renamify(dir, from, to)
.then(console.log)
.catch(console.error);
Or with es2018
async-await
syntax:
const renamify = require('renamify');
const tryToCatch = require('try-to-catch');
const dir = '/';
const from = [
'bin'
];
const to = [
'super-bin'
];
const [error] = await tryToCatch(renamify, dir, from, to);
console.log(error || 'done');
- renamify-cli - CLI rename group of files from a directory.
MIT