New: Introducing PHP and Composer Support.Read the Announcement
Socket
Book a DemoInstallSign in
Socket

rev-file

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rev-file

Get the revved file path of a file

Source
npmnpm
Version
3.0.0
Version published
Weekly downloads
1.4K
-43.53%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

rev

FAQs

Package last updated on 03 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts