An open API service indexing awesome lists of open source software.

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

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)