Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

rev-path

sindresorhus314.8kMIT3.0.0

Create a revved file path

rev, revving, web, file, name, filename, path, cache, caching

readme

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'
  • rev-file - Get the revved file path of a file