gulp-sha256-filename

2.0.0 • Public • Published

Usage of gulp-sha256-filename

NPM version Downloads Build Status Coverage Status

It's plugin for gulp rename file output with sha256 hash sum.

Installation

npm i gulp-sha256-filename

or

npm i -D gulp-sha256-filename

Example of the hash() function

Here is an example of how to use the hash() function in your gulpfile.js file:

const gulp = require('gulp');
const hash = require('gulp-sha256-filename');
 
gulp.task('assemble', function() {
return gulp.src('./assembly.json')
    .pipe(hash())
    .pipe(gulp.dest('./dist'))
});

Filename custom format

You can set a custom format for filename.

const gulp = require('gulp');
const hash = require('gulp-sha256-filename');
 
gulp.task('assemble', function() {
return gulp.src('./assembly.json')
    .pipe(hash({
        format:"{name}.{hash}{ext}"
    }))
    .pipe(gulp.dest('./dist'))
});

and set limit length at hash

const gulp = require('gulp');
const hash = require('gulp-sha256-filename');
 
gulp.task('assemble', function() {
return gulp.src('./assembly.json')
    .pipe(hash({
        format:"{name}.{hash:8}{ext}"
    }))
    .pipe(gulp.dest('./dist'))
});

Package Sidebar

Install

npm i gulp-sha256-filename

Weekly Downloads

3

Version

2.0.0

License

MIT

Unpacked Size

14.7 kB

Total Files

17

Last publish

Collaborators

  • wilmerhmg