2.0.0 • Published 5 years ago

gulp-sha256-filename v2.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

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'))
});
2.0.0

5 years ago

1.1.1

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

0.0.1-security

5 years ago