# cross-zip

> Cross-platform .zip file creation

Latest version **4.0.1** (published 2024-02-12) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2024-02-12 |
| First published | 2016-04-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/cross-zip) |
| Module format | CommonJS |
| Node | >=12.10 |
| Dependencies | 0 |
| Unpacked size | 11.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 129 |
| Author | Feross Aboukhadijeh |
| Maintainers | feross |
| Keywords | ZIP, cross platform, cross-platform, linux, mac, os x, windows, zip |

## Links

- npm: https://www.npmjs.com/package/cross-zip
- Repository: https://github.com/feross/cross-zip
- Issues: https://github.com/feross/cross-zip/issues
- Funding: https://github.com/sponsors/feross
- npm.io page: https://npm.io/package/cross-zip

## 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

- 4.0.1 (latest) — 2024-02-12
- 4.0.0 — 2020-11-03
- 3.1.0 — 2020-05-10
- 3.0.0 — 2020-01-14
- 2.1.6 — 2019-08-14
- 2.1.5 — 2016-08-13
- 2.1.4 — 2016-06-22
- 2.1.3 — 2016-05-29
- 2.1.2 — 2016-05-15
- 2.1.1 — 2016-05-15
- 2.1.0 — 2016-05-02
- 2.0.1 — 2016-04-27
- 2.0.0 — 2016-04-27
- 1.0.0 — 2016-04-16

## README

# cross-zip [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]

[ci-image]: https://img.shields.io/github/workflow/status/feross/cross-zip/ci/master
[ci-url]: https://github.com/feross/cross-zip/actions
[npm-image]: https://img.shields.io/npm/v/cross-zip.svg
[npm-url]: https://npmjs.org/package/cross-zip
[downloads-image]: https://img.shields.io/npm/dm/cross-zip.svg
[downloads-url]: https://npmjs.org/package/cross-zip
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com

### Cross-platform .zip file creation

## install

```
npm install cross-zip
```

## usage

```js
var zip = require('cross-zip')

var inPath = path.join(__dirname, 'myFolder') // folder to zip
var outPath = path.join(__dirname, 'myFile.zip') // name of output zip file

zip.zipSync(inPath, outPath)
```

## api

### `zip.zip(inPath, outPath, [callback])`

Zip the folder at `inPath` and save it to a .zip file at `outPath`. If a `callback`
is passed, then it is called with an `Error` or `null`.

### `zip.zipSync(inPath, outPath)`

Sync version of `zip.zip`.

### `zip.unzip(inPath, outPath, [callback])`

Unzip the .zip file at `inPath` into the folder at `outPath`. If a `callback` is
passed, then it is called with an `Error` or `null`.

### `zip.unzipSync(inPath, outPath)`

Sync version of `zip.unzip`.

## Windows users

This package requires [.NET Framework 4.5 or later](https://www.microsoft.com/net)
and [Powershell 3](https://www.microsoft.com/en-us/download/details.aspx?id=34595).
These come **pre-installed** on Windows 8 or later.

On Windows 7 or earlier, you will need to install these manually in order for
`cross-zip` to function correctly.

## reference

- [Stack Overflow - zipping from command line in Windows](https://stackoverflow.com/questions/17546016/how-can-you-zip-or-unzip-from-the-command-prompt-using-only-windows-built-in-ca)

## related

- [cross-zip-cli](https://github.com/jprichardson/cross-zip-cli): CLI version of cross-zip.

## license

MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).

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