Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
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
2.0.0
Version published
Weekly downloads
520
-77.78%
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 --save rev-file

Usage

const revFile = require('rev-file');

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

API

revFile(filepath)

Returns a promise for a revved filepath.

revFile.sync(filepath)

Return a revved filepath.

License

MIT © Sindre Sorhus

Keywords

rev

FAQs

Package last updated on 14 Nov 2015

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