Björn f184cd7e2a | 4 years ago | |
---|---|---|
.. | ||
LICENSE | 4 years ago | |
README.md | 4 years ago | |
index.js | 4 years ago | |
package.json | 4 years ago |
Replaces a file extension with another one.
var replaceExt = require('replace-ext');
var path = '/some/dir/file.js';
var newPath = replaceExt(path, '.coffee');
console.log(newPath); // /some/dir/file.coffee
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.
MIT