arozwalak
8/14/2015 - 4:09 PM

Javascript: Gulp replacehttps://www.npmjs.com/package/gulp-replace

var replace = require('gulp-replace');

gulp.task('default', function () {
    var index = 0;
    return gulp.src('*.txt')
        .pipe(replace(
            /^/,
            function () {
                return '---\n' +
                    'id: ' + (++index) + '\n' +
                    '---';
            }
        ))
        .pipe(gulp.dest('./dest'));
});