Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/simon-he95/simplify-zip
- Owner: Simon-He95
- Created: 2022-10-12T07:02:52.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T05:48:21.000Z (about 1 year ago)
- Last Synced: 2025-02-10T19:06:59.879Z (11 days ago)
- Language: TypeScript
- Homepage:
- Size: 216 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
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)