1.0.1 • Published 4 years ago

gulp-change-file-content v1.0.1

Weekly downloads
2
License
MIT
Repository
-
Last release
4 years ago

Gulp plugin allow modify file in .pipe

const gulp = require( 'gulp' );
const changeFileContent = require( 'gulp-change-file-content' );

gulp.task( 'js', () => (
    gulp.src( 'app/**/*.js' )
        .pipe( changeFileContent( ( content, path, file ) => {
            const start = '(function (){\n';
            const end = '\n})()';

            return `${ start }${ content }${ end }`;
        } ) )
        .pipe( gulp.dest( 'build' ) )
) );