
Return a mapped dest for a src a filepath.
Install with npm:
npm i rename-path --save-dev
var rename = require('rename-paths');
var filepath = 'a/b/c.js';
console.log(rename(filepath, {ext: '.min.js'}));
//=> 'a/b/c.min.js'
console.log(rename(filepath, {destBase: 'dist', ext: '.min.js'}));
//=> 'dist/a/b/c.min.js'
console.log(rename(filepath, {flatten: true, ext: '.min.js'}));
//=> 'c.min.js'
See the tests for more examples.
In the command line, run:
mocha
Jon Schlinkert
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license
This file was generated by verb-cli on June 28, 2014.