0.10.4 • Published 2 years ago
gulp-that v0.10.4
gulp-that
A generic gulp plugin to do anything with a stream of files
Installation
gulp-that is available on Npm. You can add it to your Node.js project with a simple command.
npm install gulp-that
How to Use
'Require' gulp-that into a variable and use it as you would use any other gulp plugin. The only special thing about gulp-that is that is needs you to tell it for what to do with the files in a stream.
const gulpThat = require('gulp-that');
gulp.task('convert-to-lengths', () => {
gulp.src('src/**/*.js')
.pipe(gulpThat(operation))
.pipe(gulp.dest('dist'));
});
The symbol operation
can be a function that is capable of transforming a string into another. For example, if it is a function like below,
const operation = inputString =>
inputString.length;
gulp-that would transform all files into their own file sizes in bytes.