rev-path

3.0.0 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.0.0
    3,050
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.0.0
    3,050
  • 2.0.0
    106,981
  • 1.0.0
    86,417

Package Sidebar

Install

npm i rev-path

Weekly Downloads

57,755

Version

3.0.0

License

MIT

Unpacked Size

2.97 kB

Total Files

4

Last publish

Collaborators

  • sindresorhus