Files
automatic-dispose/node_modules/gulp-babel/node_modules/replace-ext
2018-11-24 14:43:59 +01:00
..
2018-11-24 14:43:59 +01:00
2018-11-24 14:43:59 +01:00
2018-11-24 14:43:59 +01:00
2018-11-24 14:43:59 +01:00

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