Package Exports
- gulp-filehash
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gulp-filehash) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
gulp-filehash
Output list of files in current stream to JSON file with their checksum hashes .
Add it to your gulp file:
gulp
.src(['awesome.file', 'lame.file'])
.pipe(require('gulp-filehash')('filehash.json'))
.pipe(gulp.dest('out'))Outputs out/filehash.json:
{
"awesome.file" : "79550af37b9f41fc0fe382b8e5fc67c3e160db8b",
"lame.file" : "6a7177d9a0fd176dbbf7165693319d1fc5acdf58"
}Installation
$ npm install gulp-filehashOptions
Base : { base: 'dist' }
gulp
.src(['dist/dir1/awesome.file', 'dist/dir2/lame.file'])
.pipe(require('gulp-filehash')('filehash.json', { base: 'dist' }))
.pipe(gulp.dest('out'))Outputs:
{
"dir1/awesome.file" : "79550af37b9f41fc0fe382b8e5fc67c3e160db8b",
"dir2/lame.file" : "6a7177d9a0fd176dbbf7165693319d1fc5acdf58"
}Script: { script: true }
gulp
.src(['awesome.file', 'lame.file'])
.pipe(require('gulp-filehash')('filehash.json', { script: true }))
.pipe(gulp.dest('out'))Outputs out/filehash.json:
var fileHashes = {
"awesome.file" : "79550af37b9f41fc0fe382b8e5fc67c3e160db8b",
"lame.file" : "6a7177d9a0fd176dbbf7165693319d1fc5acdf58"
}Script with Variable Name: { script: 'hashes' }
gulp
.src(['awesome.file', 'lame.file'])
.pipe(require('gulp-filehash')('filehash.json', { script: 'hashes' }))
.pipe(gulp.dest('out'))Outputs out/filehash.json:
var hashes = {
"awesome.file" : "79550af37b9f41fc0fe382b8e5fc67c3e160db8b",
"lame.file" : "6a7177d9a0fd176dbbf7165693319d1fc5acdf58"
}