1.0.1 • Published 1 year ago

unzip-buffer v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Example:

const c = require("unzip-buffer").unzipToArr;
const fs = require("fs")
const path = require("path")

let b = fs.readFileSync("./arc.jar")

let zip = c(
  b //buffer, 
  get = { write: true } //what properties to get, 
  options = { writeTo: "./jar"}, //options { writeTo = where to write }
  pathReplacer = function(d) { //function to replace paths when being extracted
    let splt = d.split(path.sep)
    splt[splt.length - 1] = "file.txt"
    return splt.join(path.sep)
  }
)
zip.forEach(f => f.write()) //extracts to ./jar, changes all files to file.txt

Not an arr:

const c = require("unzip-buffer").unzip;

let b = fs.readFileSync("./arc.jar")

let zip = c(b);

console.log(zip["META-INF/manifest.mf"].data) //buffer of data
1.0.1

1 year ago

1.0.0

1 year ago