# nice-zip

> Simple to zip or unzip archive file.

Latest version **1.0.0** (published 2022-10-14) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-10-14 |
| First published | 2016-06-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >12.0 |
| Dependencies | 1 |
| Unpacked size | 21.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Jay.M.Hu |
| Maintainers | hm910705 |

## Links

- npm: https://www.npmjs.com/package/nice-zip
- Repository: https://github.com/hstarorg/nice-zip
- Homepage: https://github.com/hstarorg/nice-zip#readme
- Issues: https://github.com/hstarorg/nice-zip/issues
- npm.io page: https://npm.io/package/nice-zip

## Dependencies (1)

- [jszip](https://npm.io/package/jszip.md) ^3.10.1

## Recent versions

- 1.0.0 (latest) — 2022-10-14
- 0.2.1 — 2018-11-14
- 0.2.0 — 2018-03-30
- 0.1.0 — 2016-06-23

## README

# nice-zip

Simple to zip or unzip archive file.

It used [JSZip](https://github.com/Stuk/jszip) with version 3.x

# How to use?

`npm install nice-zip --save`

```ts
import niceZip from 'nice-zip';

// Extra zip package to special folder
niceZip.unzip('1.zip', 'folder1', {
  onLoad: (len) => {
    console.log(`zip include files(include folders) is: ${len}`);
  },
  onProcess: (path, index, len) => {
    console.log(`Current file is ${path}, the index is ${index}, total count is ${len}`);
  },
});

// Zip folder to a zip file
const promise = niceZip.zipFolder(folder, targetPath);
```

Other options parames: [https://stuk.github.io/jszip/documentation/api_jszip/load_async.html](https://stuk.github.io/jszip/documentation/api_jszip/load_async.html)

You can use JSzip too, like this:

```ts
const JSZip = require('nice-zip').JSZip;
```

# How to develop

## Develop

```bash
npm run dev
```

## Test

```bash
# 运行测试
npm test

# 运行测试并计算代码覆盖率
npm run cov
```

## Publish

```bash
npm run pub
```

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