2016-10-10 03:43:44 +02:00
|
|
|
# gulp-zip [![Build Status](https://travis-ci.org/sindresorhus/gulp-zip.svg?branch=master)](https://travis-ci.org/sindresorhus/gulp-zip)
|
|
|
|
|
|
|
|
> ZIP compress files
|
|
|
|
|
|
|
|
|
|
|
|
## Install
|
|
|
|
|
|
|
|
```
|
|
|
|
$ npm install --save-dev gulp-zip
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```js
|
|
|
|
const gulp = require('gulp');
|
|
|
|
const zip = require('gulp-zip');
|
|
|
|
|
2017-08-14 05:01:11 +02:00
|
|
|
gulp.task('default', () =>
|
|
|
|
gulp.src('src/*')
|
2016-10-10 03:43:44 +02:00
|
|
|
.pipe(zip('archive.zip'))
|
2017-08-14 05:01:11 +02:00
|
|
|
.pipe(gulp.dest('dist'))
|
|
|
|
);
|
2016-10-10 03:43:44 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## API
|
|
|
|
|
|
|
|
Supports [streaming mode](https://github.com/gulpjs/gulp/blob/master/docs/API.md#optionsbuffer).
|
|
|
|
|
2017-08-14 05:01:11 +02:00
|
|
|
### zip(filename, [options])
|
2016-10-10 03:43:44 +02:00
|
|
|
|
|
|
|
#### filename
|
|
|
|
|
|
|
|
Type: `string`
|
|
|
|
|
|
|
|
#### options
|
|
|
|
|
2017-08-14 05:01:11 +02:00
|
|
|
Type: `Object`
|
|
|
|
|
2016-10-10 03:43:44 +02:00
|
|
|
##### compress
|
|
|
|
|
|
|
|
Type: `boolean`<br>
|
|
|
|
Default: `true`
|
|
|
|
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
2017-08-14 05:01:11 +02:00
|
|
|
MIT © [Sindre Sorhus](https://sindresorhus.com)
|