0.9.0 • Published 2 years ago
@victorykit/unizip v0.9.0
victorykit/unizip
A uniform utility for creating ZIP archives via NodeJS through Info-Zip, or AdmZip.
Both will result in the roughly same output and share the same interface, however the compression rate may differ...
Javascript
#!/usr/bin/env node
const unizip = require( '@victorykit/unizip' );
//uses InfoZip - archives node_modules directory with a `nodejs` path prefix
var archive = new unizip.InfoZipArchive( 'test.zip' );
archive.add( 'node_modules/**/*', 'nodejs' ).close();
//uses AdmZip - archives node_modules directory with a `nodejs` path prefix
var archive2 = new zip.AdmZipArchive( 'test2.zip' );
archive2.add( 'node_modules/**/*', 'nodejs' )
archive2.close();
Shell Script (POSIX)
#!/bin/sh
#uses InfoZip
node lib/zip.js test.zip 'node_modules/**/*' -p 'nodejs' -a 'infozip'
#uses AdmZip
node lib/zip.js test.zip 'node_modules/**/*' -p 'nodejs' -a 'admzip'
#for help
node lib/zip.js --help