0.1.0 • Published 6 years ago

gulp-add v0.1.0

Weekly downloads
667
License
MIT
Repository
github
Last release
6 years ago

gulp-add

NPM version Build Status Downloads

Add files by contents at any point in the pipeline.

Install:

npm install gulp-add --save-dev

Example:

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

gulp.task('some-task', function() {
    return gulp.src(['some files'])
        .pipe(add('filename1.txt', 'First file contents'))
        .pipe(add({
            'filename2.txt': 'Second file contents',
            'filename3.txt': 'Third file contents'
        }))
        .pipe(gulp.dest('./build'));
});

By default, new files are being added to the end of the stream. You can insert new files in the beginning of the stream:

.pipe(add('filename1.txt', 'First file contents', true))

or

.pipe(add({
    'filename2.txt': 'Second file contents',
    'filename3.txt': 'Third file contents'
}, true))