1.3.0 • Published 6 years ago

gulp-save v1.3.0

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

gulp-save Build Status

Store and restore files in stream.

Install

$ npm install --save-dev gulp-save

Usage

var gulp = require('gulp');
var save = require('gulp-save');
var uglify = require('gulp-uglify');

gulp.task('default', function () {
	return gulp.src('src/*.js')
		.pipe(save('before-uglify', opts)) //cache all files here
		.pipe(uglify())
		.pipe(gulp.dest('dist'))
		.pipe(save.restore('before-uglify')) //restore all files to the state when we cached them
		.pipe(gulp.dest('dist'));

});

API

save(cache, opts)

####cache

Type: string
Default:

Key where the stream will be cached.

####opts Same as vinyl clone options

save.restore(cache)

####cache

Type: string
Default:

Key from where stream should be restored.

save.clear(cache, cache, ...)

####cache

Type: string
Default:

Cache item to clear. If save.clear is called with no parameters, it will clear the whole cache.

License

MIT © Daniel Husar