
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
MFR stands for Mass File Rename. It's a Node.js tool to rename all files inside the selected directory.
MFR stands for Mass File Rename. It's a Node.js tool to rename all files inside the selected directory.
The simplest usage of MFR looks as in the code sample:
import MFR from 'mfr';
const mfr = new MFR();
await mfr.run( options );
MFR also supports TypeScript:
import MFR from 'mfr';
const mfr: MFR = new MFR();
await mfr.run( options );
MFR needs to be configured to work properly:
mode: string - determines the library mode. Basically, there are 2 modes:
random - file names are uuids,string - file names base on the provided pattern.sourcePath: string - the path to the source directory.destinationPath: string - the destination path. The directory will be created if not exists.formats: string | string[] - the file format or array of formats. Only files with provided formats will be renamed. If not provided, all files will be renamed.pattern: string - the pattern for the string mode. REQUIRED if the string is selected.appendix: 'prefix' | 'postfix' | 'all' | 'none' - determines if generated names should have prefixes and postfixes. Basically set to none.prefixPattern: string | function - pattern for the prefix. REQUIRED if the appendix option is set to prefix or all.postfixPattern: string | function - pattern for the postfix. REQUIRED if the appendix option is set to postfix or all.To create an additional MFR behavior or modify the existing one, you can use drivers and generators.
Generators are responsible for returning only the core file name, without prefixes and postfixes.
import { IGenerator, IOptions } from 'mfr';
class CustomGenerator implements IGenerator {
// Options are available as a constructor parameter.
public constructor( private readonly _options: IOptions ) {}
public generate(): string {}
}
Drivers should use generators for creating the full file name ( without extension ) with a prefix and a postfix. Also, additional input/options validation should be added here.
import { Driver, IGenerator, IOptions, IDriver } from 'mfr';
// If you'd like to keep the original appendix validation mechanism extend the Driver class.
// Otherwise, extend the IDriver interface.
export default class CustomDriver extends Driver {
// Specify a unique driver name.
public static driverName: string = 'custom';
public constructor(
// Generatoris available as the first constructor parameter.
generator: IGenerator,
// Options are available as the second constructor parameter.
options: IOptions
) {
super( generator, options );
}
// The method should return the full file name without the extension.
public getFilename(): string {}
}
You can also add custom properties to the provided options if you need.
After creating your custom driver and generator, you need to provide it to MFR.
import MFR from 'mfr';
import { CustomGenerator, CustomDriver } from './some-destination';
const mfr: MFR = new MFR( [ { driver: CustomDriver, generator: CustomGenerator } ] );
await mfr.run( { mode: 'custom' } );
You can also use custom file system instead of the native Node.js module.
import MFR from 'mfr';
import customFileSystem from './some-destination';
const mfr: MFR = new MFR( [], customFileSystem );
MFR supports also the CLI version. To run MFR in the CLI mode install it first using npm install -g mfr.
Then you will be able to run MFR via the mfr command:
Usage: -m <mode> -s <source> -d <destination>
Options:
--help Show help [boolean]
--version Show version number [boolean]
-m, --mode Application mode [string] [required]
-s, --source Source path [string] [required]
-d, --destination Destiatnion path [string] [required]
-f, --formats Handled formats [array]
-p, --pattern Pattern [string]
-a, --appendix Appendix [string]
--pre, --prefix Prefix pattern [string]
--pos, --postfix Prefix patern [string]
Noticed a bug or a problem? Report it on GitHub repository.
Before contribute please check the CONTRIBUTING.md file.
FAQs
MFR stands for Mass File Rename. It's a Node.js tool to rename all files inside the selected directory.
We found that mfr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.