rev-file

4.0.0 • Public • Published

rev-file

Get the revved file path of a file

Reads the file, MD5-hashes it, truncates the hash to 10 characters, appends it to the filename, and returns the modified path.

Install

npm install rev-file

Usage

import {revisionFile} from 'rev-file';

console.log(await revisionFile('src/unicorn.png'));
//=> 'src/unicorn-bb9d8fe615.png'

API

revFile(filepath)

Returns a Promise for a revved file path.

revFileSync(filepath)

Returns a revved file path.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 4.0.0
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 4.0.0
    4
  • 3.0.0
    891
  • 2.0.0
    0
  • 1.0.0
    4

Package Sidebar

Install

npm i rev-file

Weekly Downloads

899

Version

4.0.0

License

MIT

Unpacked Size

3.01 kB

Total Files

4

Last publish

Collaborators

  • sindresorhus