1.1.11 • Published 1 year ago
@jeffy-g/unzip v1.1.11
@jeffy-g/unzip
use fflate unzip feature
CLI usage
command line name - ffunzip
all zip file extract to
<output directory>
If you need a detailed log, please specify the-v
option.$ ffunzip [-v] [-d <output directory>] <zip file> <zip file> <zip file> ...
NOTE: if
-d
omitted then output directory to./output
API
// DEVNOTE: 2024/01/01 - "colors" available
const unzipWithCallback = require("@jeffy-g/unzip");
/** @type {(path: TSimpleZipEntry) => void} */
const withCallback = e => {
if (e.state === "ignore" || e.type === "Folder") {
// do nothing
} else {
const state = e.state;
const color = state === "pending" ? "cyan": "green";
console.log(`${state} - ${
e.path[color]}${state !== "write" ? `, size: ${e.size?.toLocaleString().blue}`: ""
}`);
}
};
unzipWithCallback("[zipPath]", "[output directory]", withCallback);
Authors
- jeffy-g - jeffy-g
License
This project is licensed under the MIT License - see the LICENSE file for details