https://github.com/aduth/handlebars-helper-filehash
{{ fileHash }} Handlebars helper for generating an md5 hash from a file's content
https://github.com/aduth/handlebars-helper-filehash
Last synced: about 1 year ago
JSON representation
{{ fileHash }} Handlebars helper for generating an md5 hash from a file's content
- Host: GitHub
- URL: https://github.com/aduth/handlebars-helper-filehash
- Owner: aduth
- License: mit
- Created: 2014-01-12T23:32:07.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-01-14T02:03:17.000Z (over 12 years ago)
- Last Synced: 2025-03-13T22:35:06.550Z (about 1 year ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# {{ fileHash }}
The {{ fileHash }} Handlebars helper generates an md5 hash from a specified file's content. Perfect for automatically cache-busting modified assets (e.g. stylesheets).
## Quickstart
In the root of your project, run the following in the command line:
```bash
npm install handlebars-helper-filehash --save-dev
```
### Assemble Usage
If you use [Assemble](http://assemble.io) and Grunt, add `handlebars-helper-filehash` to the `helpers` property in your Gruntfile's [Assemble](http://assemble.io) task or target options:
```javascript
grunt.initConfig({
assemble: {
options: {
// the 'handlebars-helper-filehash' module must also be listed in
// devDependencies for assemble to automatically resolve the helper
helpers: ['handlebars-helper-filehash', 'foo/*.js']
}
...
}
});
```
You can now use begin using the helper in your templates. To use the helper, pass a file path and optionally include a number as a second parameter if you wish to limit the output to a set length.
__Template__:
```html
```
__Output__:
```html
```
## License and Copyright
Copyright (c) 2014 Andrew Duthie
Released freely under the MIT License (refer to LICENSE.txt)