This repository has been archived on 2020-11-02. You can view files and clone it, but cannot push or open issues or pull requests.
TripSit_Suite/node_modules/replace-ext/README.md
2020-11-01 22:46:04 +00:00

1.6 KiB

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