guilmour 4d48d7b520 Version 0.1 | 6 anni fa | |
---|---|---|
.. | ||
index.js | 6 anni fa | |
license | 6 anni fa | |
readme.md | 6 anni fa |
Modify the filename in a path
$ npm install --save modify-filename
var modifyFilename = require('modify-filename');
modifyFilename('src/unicorn.png', function (filename, extension) {
return filename + '-rainbow' + extension;
});
//=> 'src/unicorn-rainbow.png'
modifyFilename(['src/unicorn.png', 'src/pony.png'], function (filename, extension) {
return filename + '-rainbow' + extension;
});
//=> ['src/unicorn-rainbow.png', 'src/pony-rainbow.png']
MIT © Sindre Sorhus