# gulp-save

> Store and restore streams

Latest version **1.3.0** (published 2017-12-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-save
pnpm add gulp-save
yarn add gulp-save
bun add gulp-save
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2017-12-11 |
| First published | 2014-10-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Daniel Husar |
| Maintainers | efrafa, maxart |
| Keywords | gulpplugin, cache, store, restore, clear, filter |

## Links

- npm: https://www.npmjs.com/package/gulp-save
- Repository: https://github.com/danielhusar/gulp-save
- Homepage: https://github.com/danielhusar/gulp-save#readme
- Issues: https://github.com/danielhusar/gulp-save/issues
- npm.io page: https://npm.io/package/gulp-save

## Dependencies (2)

- [through2](https://npm.io/package/through2.md) ^0.6.1
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.0.0

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2017-12-11
- 1.2.1 — 2015-07-19
- 1.2.0 — 2015-07-14
- 1.1.1 — 2015-07-13
- 1.1.0 — 2015-06-16
- 1.0.4 — 2014-11-30
- 1.0.3 — 2014-11-28
- 1.0.2 — 2014-10-17
- 1.0.1 — 2014-10-16
- 1.0.0 — 2014-10-16

## README

# [gulp](http://gulpjs.com)-save [![Build Status](https://travis-ci.org/danielhusar/gulp-save.svg?branch=master)](https://travis-ci.org/danielhusar/gulp-save)

> Store and restore files in stream.


## Install

```sh
$ npm install --save-dev gulp-save
```


## Usage

```js
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](https://github.com/wearefractal/vinyl#cloneopt)

### 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](https://github.com/danielhusar)

---
_Source: https://npm.io/package/gulp-save · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
