npm.io
2.0.1 • Published 7 years ago

rev-path-dxb

Licence
MIT
Version
2.0.1
Deps
1
Size
3 kB
Vulns
0
Weekly
0
Stars
21

rev-path-dxb Build Status

Create a revved file path

Install

$ npm install rev-path-dxb

Usage

const revPath = require('rev-path-dxb');
const hash = 'bb9d8fe615'

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

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

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