Asset manifest generator for gulp (hashes and subresource integrity)
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.eslintrc.js
.gitignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
index.js
package.json

README.md

gulp-bankrupt

Build Status

An asset manifest generator that includes hashes and subresource integrity.

Usage

const bankrupt = require('gulp-bankrupt'),
  gulp = require('gulp');

gulp.task('bankrupt', function() {
  return gulp.src('./public/*.png').pipe(bankrupt()).pipe(gulp.dest('.'))
});

When you run gulp bankrupt you should see a file in your gulp.dest named manifest.json that has the hashes and sri values for every file in the input.

For example:

{
  "/home/mario/src/express-example/public/logo.png": {
    "hash":"ef910cd40fefc2b1e641e84e95328425",
    "sri":"sha384-YR9vHfDsFvr2xGF1PXPTa/UPKKZh/U8hYJc9kd+pr/dbNo/on9Ovt2QMKUsJwm9z"
  },
  "/home/mario/src/express-example/public/img1.png": {
    "hash":"4018517e00fbc5a6516857fe1875e989",
    "sri":"sha384-ixgi3CSwa9S3vguJmugaYNA30MCZXW3wSFoOk241yNS1zn9mZVaNoNniJbBUe3e4"
  }
}