rev-path
v3.0.0 rev revving web file name filename path cache caching and 1 more...
rev-path
Create a revved file path
Install
npm install rev-path
Usage
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 - Get the revved file path of a file
npm i rev-path
Metadata
- MIT
- ^12.20.0 || ^14.13.1 || >=16.0.0
- Sindre Sorhus
- released 11/9/2021