/node-renamify

Rename group of files from a directory

Primary LanguageJavaScriptMIT LicenseMIT

Renamify License NPM version Build Status Coverage Status

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