set-base-name
v2.0.0
Published
set a new base name (part of name before extension) to a file
Downloads
4
Readme
Set base name
Set base name of a file keeping extension.
Install
npm i set-base-name
Usage Example
> ls
hello.js hello.spec.js
> set-base-name index *.js
> ls
index.js index.spec.js
API
import setBaseName from 'set-base-name';
setBaseName('index', 'hello.js');
// returns
'index.js';
setBaseName('index', 'hello.spec.js');
// returns
'index.spec.js';
License
MIT