PackDir
Pack specified directory with native current OS command line tools.
Main purpose for this lib was to pack the Electron app.
So, by default, if specified path
has a darwin
in it's name,
the directory will be packed as DMG under OS X.
Usage
Get the package via NPM: npm install pack-dir
.
const Pack = ; // Set custom DMG RegEx, default is `/darwin/`.Pack; // Pack the directorylet zipPath = Pack;// Extract to directorylet extractedPath = Pack; // Async examplePack;let zipPath = Pack;
Parameters
dmg
boolean|RegEx
, check to pack into DMG instead of ZIP.dmgFormat
string
, thehdiutil -format
parameter value (docs).isSilent
boolean
,false
, will write only Errors to console.isSync
boolean
,true
, synchronous packaging.skipDirName
boolean
,true
, don't create extra directory inside ZIP archive.zipOutputMaxBuffer
int
,1024 * 200
.
Credits
Created by Annexare Studio. Feel free to use it as you need in your apps or send updates into this public repository. All code is under MIT license.
7-Zip
For Windows host 7-Zip standalone console app is used (~1MB, doesn't require installation). All license files are included with it, with respect to the author (Igor Pavlov).