Socket
Book a DemoInstallSign in
Socket

rename-path

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rename-path

Return a mapped dest for a src a filepath.

latest
Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
4
-50%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

ext

FAQs

Package last updated on 31 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts