rename-path
Return a mapped dest for a src a filepath.
Last updated 12 years ago by jonschlinkert .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install rename-path 
SYNC missed versions from official npm registry.

rename-path NPM version

Return a mapped dest for a src a filepath.

Install

Install with npm:

npm i rename-path --save-dev

Usage

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.

Tests

In the command line, run:

mocha

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license


This file was generated by verb-cli on June 28, 2014.

Current Tags

  • 0.2.0                                ...           latest (12 years ago)

3 Versions

  • 0.2.0                                ...           12 years ago
  • 0.1.1                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (3)
Dev Dependencies (3)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |