0.0.2 • Published 1 year ago

simplify-zip v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

img

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

Install

  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