https://github.com/creativelive/rind-hash-gulp
generate cdn md5 hash
https://github.com/creativelive/rind-hash-gulp
Last synced: about 2 months ago
JSON representation
generate cdn md5 hash
- Host: GitHub
- URL: https://github.com/creativelive/rind-hash-gulp
- Owner: creativelive
- License: mit
- Created: 2014-06-04T01:24:04.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-06-26T02:59:47.000Z (about 12 years ago)
- Last Synced: 2025-09-16T14:16:42.978Z (10 months ago)
- Language: JavaScript
- Size: 259 KB
- Stars: 1
- Watchers: 11
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [](https://github.com/creativelive/rind) rind-hash-gulp [](https://travis-ci.org/creativelive/rind-hash-gulp)
Gulp task to generate an md5 mapped directory of assets.
Given filesystem input:
```
├── img
│ └── rind.png
├── js
│ └── hello.js
└── txt
└── sample.txt
```
Produces:
```
├── hash.json
├── img
│ └── rind.d6bc63f.png
├── js
│ └── hello.d81ffe3.js
└── txt
└── sample.6f5902a.txt
```
Where `hash.json` will contain the mapping from original filename to md5'd version:
```
{
"/img/rind.png": "/img/rind.d6bc63f.png",
"/js/hello.js": "/js/hello.d81ffe3.js",
"/txt/sample.txt": "/txt/sample.6f5902a.txt"
}
```
## Usage
```
var gulp = require('gulp');
var hash = require('rind-hash-gulp');
/*
var opts = {
cwd: // directory to glob
output: // output directory
hash: // path and filename for hash.json
mapping: // if set to `dev` then hash.json will point to original files
copy: // glob pattern of files to just copy instead of md5'ing
symbol: // separator between file path and md5, defaults to '.'
verbose: // output process
};
*/
gulp.task('hash', hash(gulp, opts));
```