A library for creating, reading and editing .zip files with JavaScript, with a lovely and simple API.
See https://raw.githubusercontent.com/moomle00000/jszip-function-buffer/main/index.js for all the documentation.
const fetch = require('cross-fetch');
const jszip = require("jszip");
const zip = await jszip.loadAsync(buffer)
const folder = await Object.keys(zip.files)
const file = await zip.file(folder[0]).async("nodebuffer")
const data = await file.toString()
get data from url zip file
async function downloadFile(url) {
const response = await fetch(url);
const data = await response.arrayBuffer();
return data
}
function get data text file or other file extract from zip file
async function jszipe(buffer){
const zip = await jszip.loadAsync(buffer)
const folder = await Object.keys(zip.files)
const file = await zip.file(folder[0]).async("nodebuffer")
const data = await file.toString()
return data;
}
JSZip is dual-licensed. You may use it under the MIT license or the LM license. See LICENSE.