Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/segment-boneyard/cache-bust
Create cache-busted versions of a file using the MD5 hash of the file's contents.
https://github.com/segment-boneyard/cache-bust
Last synced: about 7 hours ago
JSON representation
Create cache-busted versions of a file using the MD5 hash of the file's contents.
- Host: GitHub
- URL: https://github.com/segment-boneyard/cache-bust
- Owner: segment-boneyard
- Created: 2013-09-30T23:26:10.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-07-14T05:22:12.000Z (over 9 years ago)
- Last Synced: 2024-11-09T22:12:18.589Z (6 days ago)
- Language: JavaScript
- Size: 124 KB
- Stars: 5
- Watchers: 39
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# cache-bust
Create cache-busted versions of a file using the MD5 hash of the file's contents.
## Installation
```
$ npm install cache-bust
```## Example
```js
var bust = require('cache-bust');
var file = path.resolve(__dirname, 'build.js');bust(file); // creates a "build-43c191bf6d6c3f263a8cd0efd4a058ab.js"
```## API
### cacheBust(file, [options])
Create a cache-busted version of `file` in the same directory, removing previously cache-busted copies if they exist.
Options:
{
remove: false
}### cacheBust.remove(file)
Remove any existing cache-busted versions of a `file`.### cacheBust.alias(file)
Return the cache-busted alias for a given `file`.
## License
MIT