Sha256: db346ac3b12b2d228d0da3ba7448089fce3afc2268bd1b5b67db5a385f5bf865

Contents?: true

Size: 1.59 KB

Versions: 27

Compression:

Stored size: 1.59 KB

Contents

<p align="center">
  <a href="http://gulpjs.com">
    <img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
  </a>
</p>

# replace-ext

[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]

Replaces a file extension with another one.

## Usage

```js
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

[downloads-image]: http://img.shields.io/npm/dm/replace-ext.svg
[npm-url]: https://www.npmjs.com/package/replace-ext
[npm-image]: http://img.shields.io/npm/v/replace-ext.svg

[travis-url]: https://travis-ci.org/gulpjs/replace-ext
[travis-image]: http://img.shields.io/travis/gulpjs/replace-ext.svg?label=travis-ci

[appveyor-url]: https://ci.appveyor.com/project/gulpjs/replace-ext
[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/replace-ext.svg?label=appveyor

[coveralls-url]: https://coveralls.io/r/gulpjs/replace-ext
[coveralls-image]: http://img.shields.io/coveralls/gulpjs/replace-ext/master.svg

[gitter-url]: https://gitter.im/gulpjs/gulp
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg

Version data entries

27 entries across 27 versions & 4 rubygems

Version Path
trusty-cms-5.0.7 node_modules/replace-ext/README.md
trusty-cms-5.0.6 node_modules/replace-ext/README.md
trusty-cms-5.0.5 node_modules/replace-ext/README.md
trusty-cms-5.0.4 node_modules/replace-ext/README.md
trusty-cms-5.0.3 node_modules/replace-ext/README.md
trusty-cms-5.0.2 node_modules/replace-ext/README.md
trusty-cms-5.0.1 node_modules/replace-ext/README.md
trusty-cms-4.3.5 node_modules/replace-ext/README.md
trusty-cms-5.0.0 node_modules/replace-ext/README.md
trusty-cms-4.3.4 node_modules/replace-ext/README.md
trusty-cms-4.3.3 node_modules/replace-ext/README.md
trusty-cms-4.3.2 node_modules/replace-ext/README.md
trusty-cms-4.3.1 node_modules/replace-ext/README.md
trusty-cms-4.3 node_modules/replace-ext/README.md
trusty-cms-4.2.3 node_modules/replace-ext/README.md
trusty-cms-4.2.2 node_modules/replace-ext/README.md
trusty-cms-4.2.1 node_modules/replace-ext/README.md
trusty-cms-4.2 node_modules/replace-ext/README.md
trusty-cms-4.1.9 node_modules/replace-ext/README.md
trusty-cms-4.1.8 node_modules/replace-ext/README.md