# gulp-tar

> Create tarball from files

Latest version **5.0.0** (published 2025-09-16) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 60/100 (C)** — status: stable.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2025-09-16 |
| First published | 2013-12-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=20 |
| Dependencies | 4 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 31 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | gulpplugin, tar, tarball, archive, archiver, compress, compression, file, files, stream, streams |

## Links

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

## Dependencies (4)

- [vinyl](https://npm.io/package/vinyl.md) ^3.0.1
- [archiver](https://npm.io/package/archiver.md) ^7.0.1
- [@types/archiver](https://npm.io/package/@types/archiver.md) ^6.0.3
- [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

- 5.0.0 (latest) — 2025-09-16
- 4.0.0 — 2023-11-03
- 3.1.0 — 2019-11-19
- 3.0.1 — 2019-10-04
- 3.0.0 — 2019-08-18
- 2.1.0 — 2017-12-31
- 2.0.0 — 2017-06-08
- 1.9.0 — 2016-04-08
- 1.8.0 — 2015-12-23
- 1.7.0 — 2015-12-09
- 1.6.0 — 2015-11-14
- 1.5.0 — 2015-10-15
- 1.4.0 — 2015-02-16
- 1.3.2 — 2014-12-25
- 1.3.1 — 2014-11-21
- … 11 more at https://npm.io/package/gulp-tar/versions

## README

# gulp-tar

> Create [tarball](https://en.wikipedia.org/wiki/Tar_(computing)) from files

## Install

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

## Usage

```js
import gulp from 'gulp';
import tar from 'gulp-tar';
import gzip from 'gulp-gzip';

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

## API

### tar(filename, options?)

#### filename

Type: `string`

The filename for the output tar archive.

#### options

Type: `object`

Default options passed to [Archiver](https://github.com/archiverjs/node-archiver)'s [constructor](https://archiverjs.com/docs/Archiver.html) and merged into the [data](https://archiverjs.com/docs/global.html#TarEntryData) passed to its [`append`](https://archiverjs.com/docs/Archiver.html#append) method.

##### Cross-platform permissions

On Windows, directories created by the filesystem often lack execute permissions, which can cause "Permission denied" errors when extracting tarballs on Unix systems. This package automatically detects and fixes this issue on Windows by letting Archiver use proper defaults for directories without execute permissions.

If you need to explicitly control this behavior, you can use `{mode: null}` to always use Archiver's defaults, regardless of the source file permissions.

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