# modify-filename

> Modify the filename in a path

Latest version **2.0.0** (published 2021-10-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install modify-filename
pnpm add modify-filename
yarn add modify-filename
bun add modify-filename
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2021-10-18 |
| First published | 2015-05-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | ^12.20.0 \|\| ^14.13.1 \|\| >=16.0.0 |
| Dependencies | 0 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | modify, change, replace, filename, file, name, path |

## Links

- npm: https://www.npmjs.com/package/modify-filename
- Repository: https://github.com/sindresorhus/modify-filename
- Homepage: https://github.com/sindresorhus/modify-filename#readme
- Issues: https://github.com/sindresorhus/modify-filename/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/modify-filename

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2021-10-18
- 1.1.0 — 2015-06-27
- 1.0.0 — 2015-05-22

## README

# modify-filename

> Modify the filename in a path

## Install

```sh
npm install modify-filename
```

## Usage

```js
import modifyFilename from 'modify-filename';

modifyFilename('src/unicorn.png', (filename, extension) => {
	return `${filename}-rainbow${extension}`;
});
//=> 'src/unicorn-rainbow.png'

modifyFilename(['src/unicorn.png', 'src/pony.png'], (filename, extension) => {
	return `${filename}-rainbow${extension}`;
});
//=> ['src/unicorn-rainbow.png', 'src/pony-rainbow.png']
```

---
_Source: https://npm.io/package/modify-filename · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
