Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/simon-he95/simplify-zip

simplify-zip
https://github.com/simon-he95/simplify-zip

Last synced: 8 days ago
JSON representation

simplify-zip

Awesome Lists containing this project

README

        

![img](/assets/kv.png)

Generate a zip file with a multi-level directory structure with simple parameters

## Install
```bash
npm install simplify-zip
```

## Usage
```
# if type === 'folder' then will be created a folder with the name of the key else will be created a file with the name of the key
# picutes can use `import` or `require` or `url` to import the image
import picture from "../public/favicon.jpg";

simplifyZIP({
image: {
content: {
"favicon.jpg": {
content: picture,
type: "image",
},
"xxx.jpg": {
content: '../assets/xxx.jpg',
type: "image",
},
},
type: "folder",
},
"hello.txt": {
content: "hello world",
type: "text",
},
});
```

## Thanks
- [`jszip`](https://www.npmjs.com/package/jszip)
- [`file-saver`](https://www.npmjs.com/package/file-saver)
- [`lazy-js-utils`](https://github.com/Simon-He95/lazy-js-utils)

Buy Me A Coffee