# rev-path

> Create a revved file path

Latest version **3.0.0** (published 2021-11-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install rev-path
pnpm add rev-path
yarn add rev-path
bun add rev-path
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2021-11-09 |
| 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 | 1 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | rev, revving, web, file, name, filename, path, cache, caching |

## Links

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

## Dependencies (1)

- [modify-filename](https://npm.io/package/modify-filename.md) ^2.0.0

## 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

- 3.0.0 (latest) — 2021-11-09
- 2.0.0 — 2017-10-03
- 1.0.0 — 2015-05-22

## README

# rev-path

> Create a [revved file path](http://blog.risingstack.com/automatic-cache-busting-for-your-css/)

## Install

```sh
npm install rev-path
```

## Usage

```js
import {revPath, unrevPath} from 'rev-path';

const hash = 'bb9d8fe615'

const path = revPath('src/unicorn.png', hash);
//=> 'src/unicorn-bb9d8fe615.png'

revPath('src/unicorn.png', Date.now());
//=> 'src/unicorn-1432309925925.png'

// You can also revert an already hashed path
unrevPath(path, hash);
//=> 'src/unicorn.png'
```

## Related

- [rev-file](https://github.com/sindresorhus/rev-file) - Get the revved file path of a file

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