# ziptree

> Node.js module for creating .zip files from a object tree

Latest version **0.1.2** (published 2018-11-08) · 0 weekly downloads

## Install

```sh
npm install ziptree
pnpm add ziptree
yarn add ziptree
bun add ziptree
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2018-11-08 |
| First published | 2014-03-19 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 1 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 (+7 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Carlos Fernández Llamas |
| Maintainers | sirikon |

## Links

- npm: https://www.npmjs.com/package/ziptree
- Repository: https://github.com/Sirikon/ziptree
- Homepage: https://github.com/Sirikon/ziptree#readme
- Issues: https://github.com/Sirikon/ziptree/issues
- npm.io page: https://npm.io/package/ziptree

## Dependencies (1)

- [adm-zip](https://npm.io/package/adm-zip.md) 0.4.11

## Recent versions

- 0.1.2 (latest) — 2018-11-08
- 0.1.0 — 2014-03-23
- 0.0.2 — 2014-03-20
- 0.0.1 — 2014-03-19

## README

Ziptree
=======

Node.js module for creating .zip files from a object tree

## Install ##
Via NPM

    npm install ziptree
    
## Usage ##

```javascript
var foto = fs.readFileSync(process.cwd() + '/foto.jpg');

var Ziptree = require('ziptree');

var file = new ziptree({
	'testfile1.txt': 'This is a String',
	'testfile2.txt': 123456,
	'photo.jpg': foto,
	'folder': {
		'samephoto.jpg': foto,
		'im_gonna_get_you_too.txt': 'Another one bites the dust...',
		'folder-ception': {
			'photoagain.jpg': foto
		}
	}
});
```

var data = file.toBuffer();
    
Then 'data' will have the zip file's buffer with the next file tree

    files.zip
    |- testfile1.txt    // This is a String
    |- testFile2.txt    // 123456
    |- photo.jpg        // < The photo >
    |- folder           // < A folder >
      |- samephoto.jpg               // < The photo >
      |- im_gonna_get_you_too.txt    // Another one bites the dust...
      |- folder-ception              // < A folder >
        |- photoagain.jpg              // < The photo >
    
## License ##

MIT

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