Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/annexare/packdir
Pack directory with native command line tools (ZIP, DMG, Node.js, cross-platform).
https://github.com/annexare/packdir
7z dmg electron zip
Last synced: about 2 months ago
JSON representation
Pack directory with native command line tools (ZIP, DMG, Node.js, cross-platform).
- Host: GitHub
- URL: https://github.com/annexare/packdir
- Owner: annexare
- License: mit
- Created: 2016-04-12T10:49:17.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-02T13:04:38.000Z (about 6 years ago)
- Last Synced: 2024-10-08T14:08:46.132Z (3 months ago)
- Topics: 7z, dmg, electron, zip
- Language: JavaScript
- Homepage: https://annexare.github.io/PackDir
- Size: 1.17 MB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PackDir
[![NPM](https://img.shields.io/npm/v/pack-dir.svg "NPM package version")](https://www.npmjs.com/package/pack-dir)
[![Travis CI](https://api.travis-ci.org/annexare/PackDir.svg "Travis CI")](https://travis-ci.org/annexare/PackDir)
[![AppVeyor CI](https://ci.appveyor.com/api/projects/status/dprobj2m351v6aaa?svg=true "AppVeyor CI")](https://ci.appveyor.com/project/z-ax/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`.
```js
const Pack = require('pack-dir');// Set custom DMG RegEx, default is `/darwin/`.
Pack.param('dmg', /osx/);// Pack the directory
let zipPath = Pack.path('some/test/dir');
// Extract to directory
let extractedPath = Pack.extract(zipPath, 'some/destination');// Async example
Pack.param('isSync', false);
let zipPath = Pack.path('some/test/dir', (error, stdout, stderr) => {
// ...
});
```### Parameters
* `dmg` `boolean|RegEx`, check to pack into DMG instead of ZIP.
* `dmgFormat` `string`, the `hdiutil -format` parameter value ([docs](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/hdiutil.1.html)).
* `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](https://annexare.com/).
Feel free to use it as you need in your apps or send updates into [this](https://github.com/annexare/PackDir) public repository.
All code is under MIT license.## 7-Zip
For Windows host [7-Zip](http://www.7-zip.org/) standalone console app is used
(~1MB, doesn't require installation).
All license files are included with it, with respect to the author (Igor Pavlov).