guilmour 4d48d7b520 Version 0.1 | 6 lat temu | |
---|---|---|
.. | ||
index.js | 6 lat temu | |
license | 6 lat temu | |
readme.md | 6 lat temu |
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