npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

rev-file

3.0.0 • Public • Published

rev-file Build Status

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

const revFile = require('rev-file');
 
revFile('src/unicorn.png').then(filepath => {
    console.log(filepath);
    //=> 'src/unicorn-bb9d8fe615.png'
});

API

revFile(filepath)

Returns a Promise for a revved filepath.

revFile.sync(filepath)

Returns a revved filepath.

License

MIT © Sindre Sorhus

install

npm i rev-file

Downloadsweekly downloads

108

version

3.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability