Skip to content

Provides dynamically updated file hashes for cache busting

License

Notifications You must be signed in to change notification settings

valpackett/dynamic-asset-rev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dynamic-asset-rev npm version npm downloads Dependency Status Unlicense

A module that provides dynamically updated file hashes for cache busting, using chokidar to watch for file changes and update their hashes.

Installation

$ npm install --save dynamic-asset-rev

Usage

const assets = require('dynamic-asset-rev')('dist')

// ... use something like this in your HTML template:
assets.url('style.css')
// which is the same as:
'style.css?' + assets.hashes['style.css']

// When you overwrite style.css, the hash value will change!

Contributing

Please feel free to submit pull requests!

By participating in this project you agree to follow the Contributor Code of Conduct.

License

This is free and unencumbered software released into the public domain.
For more information, please refer to the UNLICENSE file or unlicense.org.

About

Provides dynamically updated file hashes for cache busting

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published