Skip to content

About

Replaces a file extension with another one.

Topics

Resources

Security policy

Stars

47 stars

Watchers

5 watching

Forks

Repository files navigation

replace-ext

NPM version Downloads Build Status Coveralls Status

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.

Strict No LLM / No AI Policy

No LLMs for issues.

No LLMs for patches / pull requests.

No LLMs for comments on the bug tracker, including translation.

English is encouraged, but not required. You are welcome to post in your native language and rely on others to have their own translation tools of choice to interpret your words.

License

MIT

About

Replaces a file extension with another one.

Topics

Resources

Security policy

Stars

47 stars

Watchers

5 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages