tree: d80b92cf5e37ce0b53a0ef855d7f251bda930661 [path history] [tgz]
  1. index.js
  2. LICENSE
  3. package.json
  4. README.md
node_modules/replace-ext/README.md

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