jjdltc / jjdltc-cordova-plugin-zip

A plugin to zip and unzip files or directories
MIT License
22 stars 25 forks source link

Will this work in Ionic frameworks ?? #15

Closed pratiksan45 closed 4 years ago

pratiksan45 commented 4 years ago

I wanted to zip a text file in my ionic app. Can I use this ??

jjdltc commented 4 years ago

Yes, it will work (I used a few time on Ionic). But be advised that you must manage the typescript integration.

pratiksan45 commented 4 years ago

Will this also compress the file size when converted into zip ?? I have previously used https://github.com/Touffy/client-zip but that was giving me the zip files of same sizes as of the file .

jjdltc commented 4 years ago

Yes @pratiksan45 it's will compress the files and folders, but keep in mind that depending on the file(s) to compress, the size diff may or may not be notable.

pratiksan45 commented 4 years ago

Ok. Thankyou. On last question. Is this strictly for Cordova not for capacitor ??

jjdltc commented 4 years ago

@pratiksan45 I have never try this with Capacitor, so I can't tell if will work or not with capacitor. This may help => https://capacitorjs.com/docs/cordova/using-cordova-plugins

pratiksan45 commented 4 years ago

Hi, Thanks for the updates, I am trying to use your plugin in my Ionic project, I have installed the plugin with npm install cordova-plugin-zip , But I am not able to import it using import { JJZip} from 'cordova-plugin-zip; It is giving me error. Can you tell how did you import the plugin in Ionic ( Since you said you have used this in Ionic Framework )

jjdltc commented 4 years ago

@pratiksan45 About working with Ionic 👇

Yes, it will work (I used a few time on Ionic). But be advised that you must manage the typescript integration.

So, "The object JJzip is expose in the window" from that you will need to manage the integration with Typescript, I usually create a service that wrap that behave.

Feel free to add support to Typescript in P.R. 😄.

UsamaParkar commented 3 years ago

Can you show a demonstration or some sample code for working with Ionic, or including the project in ionic. It will really help me out. I'm fairly new to this.