# gulp-zip

> ZIP compress files

Latest version **6.1.0** (published 2025-01-09) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 38/100 (D)** — status: maintenance-mode.

Positive: has types package; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 6.1.0 |
| Published | 2025-01-09 |
| First published | 2013-12-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/gulp-zip) |
| Module format | ESM |
| Node | >=18 |
| Dependencies | 4 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 271 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | gulpplugin, zip, archive, archiver, compress, compression, file |

## Links

- npm: https://www.npmjs.com/package/gulp-zip
- Repository: https://github.com/sindresorhus/gulp-zip
- Homepage: https://github.com/sindresorhus/gulp-zip#readme
- Issues: https://github.com/sindresorhus/gulp-zip/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/gulp-zip

## Dependencies (4)

- [yazl](https://npm.io/package/yazl.md) ^3.3.1
- [vinyl](https://npm.io/package/vinyl.md) ^3.0.0
- [get-stream](https://npm.io/package/get-stream.md) ^9.0.1
- [gulp-plugin-extras](https://npm.io/package/gulp-plugin-extras.md) ^1.1.0

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 6.1.0 (latest) — 2025-01-09
- 6.0.0 — 2023-11-03
- 5.1.0 — 2021-03-10
- 5.0.2 — 2020-06-27
- 5.0.1 — 2019-10-04
- 5.0.0 — 2019-05-28
- 4.2.0 — 2018-07-27
- 4.1.0 — 2017-12-30
- 4.0.0 — 2017-01-25
- 3.2.0 — 2016-02-17
- 3.1.0 — 2016-01-18
- 3.0.2 — 2015-04-02
- 3.0.1 — 2015-04-01
- 3.0.0 — 2015-03-27
- 2.0.3 — 2015-02-24
- … 15 more at https://npm.io/package/gulp-zip/versions

## README

# gulp-zip

> ZIP compress files

## Install

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

## Usage

```js
import gulp from 'gulp';
import zip from 'gulp-zip';

export default () => (
	gulp.src('src/*')
		.pipe(zip('archive.zip'))
		.pipe(gulp.dest('dist'))
);
```

## API

Supports [streaming mode](https://github.com/gulpjs/gulp/blob/master/docs/API.md#optionsbuffer).

### zip(filename, options?)

#### filename

Type: `string`

#### options

Type: `object`

##### compress

Type: `boolean`\
Default: `true`

##### modifiedTime

Type: `Date`\
Default: `undefined`

Overrides the modification timestamp for all files added to the archive.

Tip: Setting it to the same value across executions enables you to create stable archives that change only when the contents of their entries change, regardless of whether those entries were "touched" or regenerated.

##### buffer

Type: `boolean`\
Default: `true`

If `true`, the resulting ZIP file contents will be a buffer. Large zip files may not be possible to buffer, depending on the size of [Buffer MAX_LENGTH](https://nodejs.org/api/buffer.html#buffer_buffer_constants_max_length).

If `false`, the ZIP file contents will be a stream.

We use this option instead of relying on [gulp.src's `buffer` option](https://gulpjs.com/docs/en/api/src/#options) because we are mapping many input files to one output file and can't reliably detect what the output mode should be based on the inputs, since Vinyl streams could contain mixed streaming and buffered content.

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