Skip to content

Append md5 value to a path in order to prevent cache

Notifications You must be signed in to change notification settings

tongjieme/md5-fingerprint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quick Examples

npm install md5-fingerprint --save
var md5Fingerprint = require('md5-fingerprint');

md5Fingerprint.filesToFolder(['html/**/home.html'], 'dest/', 'html', function(err){
	if(err) throw err;
	console.log('done');
});

Before

html/home.html
<html>
	<head>
		<script src="myjsfile.js?v=__md5('myjsfile.js')"></script>
	</head>
</html>

After

dest/home.html
<html>
	<head>
		<script src="myjsfile.js?v=8c16eea7f5"></script>
	</head>
</html>

Options

md5Fingerprint.filesToFolder(paths, dest, noDir, cb);

paths

Files paths to proccess

dest

The output destination

noDir

Do not generate directory. i.e. 'html' 'src'

cb

The callback function after process complete

About

Append md5 value to a path in order to prevent cache

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published