modify-filename

Modify the filename in a path

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
modify-filename
1602.0.03 years ago9 years agoMinified + gzip package size for modify-filename in KB

Readme

modify-filename
Modify the filename in a path

Install

npm install modify-filename

Usage

import modifyFilename from 'modify-filename';

modifyFilename('src/unicorn.png', (filename, extension) => {
	return `${filename}-rainbow${extension}`;
});
//=> 'src/unicorn-rainbow.png'

modifyFilename(['src/unicorn.png', 'src/pony.png'], (filename, extension) => {
	return `${filename}-rainbow${extension}`;
});
//=> ['src/unicorn-rainbow.png', 'src/pony-rainbow.png']