rev-file

Get the revved file path of a file

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
rev-file
4.0.02 years ago9 years agoMinified + gzip package size for rev-file in KB

Readme

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.