# easy-zip

> Easy zip is extend from jszip,run in the nodejs.

Latest version **0.0.4** (published 2013-04-18) · BSD license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2013-04-18 |
| First published | 2013-04-17 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Owen Zhong |
| Maintainers | owenchong |
| Keywords | nodejs, zip, node-zip, easy-zip, jszip |

## Links

- npm: https://www.npmjs.com/package/easy-zip
- Repository: https://github.com/owenchong/easy-zip
- npm.io page: https://npm.io/package/easy-zip

## Dependencies (1)

- [async](https://npm.io/package/async.md) latest

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

- 0.0.4 (latest) — 2013-04-18
- 0.0.3 — 2013-04-17
- 0.0.2 — 2013-04-17
- 0.0.1 — 2013-04-17

## README

Easy zip is extend from [jszip](http://stuk.github.io/jszip/),and run in the nodejs.

## Installation
    $ npm install easy-zip

## Examples
```js
var EasyZip = require('easy-zip').EasyZip;

var zip = new EasyZip();
//add text 
zip.file('hello.txt','Hello World！');
zip.writeToFile('text.zip');//write zip data to disk

//add folder
var zip2 = new EasyZip();
var jsFolder = zip2.folder('js');
jsFolder.file('hello.js','alert("hello world")');
zip2.writeToFile('folder.zip');

//add file
var zip3 = new EasyZip();
zip3.addFile('main.js','easyzip.js',function(){
	zip3.writeToFile('file.zip');
});

//batch add files
var files = [
	{source : 'easyzip.js',target:'easyzip.js'},
	{target : 'img'},//if source is null,means make a folder
	{source : 'jszip.js',target:'lib/tmp.js'}
];
var zip4 = new EasyZip();
zip4.batchAdd(files,function(){
	zip4.writeToFile('batchadd.zip');
});

//zip a folder
var zip5 = new EasyZip();
zip5.zipFolder('../easy-zip',function(){
	zip5.writeToFile('folderall.zip');
});

//write data to http.Response
//zip.writeToResponse(response,'attachment.zip');

//write to file sync 
//zip.writeToFileSycn(filePath);
```
## License
BSD

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