npm

Need private packages and team management tools?Check out npm Orgs. »

replace-ext

1.0.0 • Public • Published

replace-ext

NPM version Downloads Build Status AppVeyor Build Status Coveralls Status Gitter chat

Replaces a file extension with another one.

Usage

var replaceExt = require('replace-ext');
 
var path = '/some/dir/file.js';
var newPath = replaceExt(path, '.coffee');
 
console.log(newPath); // /some/dir/file.coffee

API

replaceExt(path, extension)

Replaces the extension from path with extension and returns the updated path string.

Does not replace the extension if path is not a string or is empty.

License

MIT

install

npm i replace-ext

Downloadsweekly downloads

4,640,619

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability