Changes the the extension of a given filename or path.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test
.gitignore
.travis.yml
LICENSE
README.md
package.json

README.md

rename-extension

Travis Build Status Coverage Status Dependencies

A function that changes the the extension of a given filename or path.

Install

npm install rename-extension

Usage

const renameExtension = require('rename-extension')

renameExtension('a/b/c.js', null) // a/b/c
renameExtension('a/b/c.js', 'css') // a/b/c.css
renameExtension('a/b/.npmrc', null) // a/b/.npmrc
renameExtension('a/b/.npmrc', 'json') // a/b/.npmrc.json