# swg-rev-path

> Create a revved file path

Latest version **1.0.0** (published 2017-05-17) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-05-17 |
| First published | 2017-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 1 |
| 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/swg-rev-path
- Repository: https://github.com/sindresorhus/rev-path
- Issues: https://github.com/sindresorhus/rev-path/issues
- npm.io page: https://npm.io/package/swg-rev-path

## Dependencies (1)

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

## Recent versions

- 1.0.0 (latest) — 2017-05-17

## README

# rev-path [![Build Status](https://travis-ci.org/sindresorhus/rev-path.svg?branch=master)](https://travis-ci.org/sindresorhus/rev-path)

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


## Install

```
$ npm install --save rev-path
```


## Usage

```js
var revPath = require('rev-path');
var hash = 'bb9d8fe615'

var 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
revPath.revert(path, hash);
//=> 'src/unicorn.png'
```


## License

MIT © [Sindre Sorhus](http://sindresorhus.com)

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