Skip to content

moomle0000/jszip-function-buffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

jszip-function-buffer Build Status Code Climate

Selenium Test Status

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;
}

License

JSZip is dual-licensed. You may use it under the MIT license or the LM license. See LICENSE.

Releases

No releases published

Packages

No packages published