From 153fff159c66eb84c46cfbc2333dac81badfa27c Mon Sep 17 00:00:00 2001 From: Quentin Rossetti Date: Tue, 26 Aug 2014 12:15:34 +0000 Subject: [PATCH] v0.1.0 --- CHANGELOG.md | 7 +++++ README.md | 79 ++++++++++++++++++++++++++++++++++++++++++---------- package.json | 2 +- 3 files changed, 73 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4127383..24c31ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Changelog ========= +### `v0.1.0` 2014-08-26 + + * Feature: Add: `Zip.add`. + * Feature: Delete: `Zip.delete`. + * Feature: Update: `Zip.update`. + * Dependencies: Use `7za` instead of `7z` so it is easier to setup on Windows. + ### `v0.0.2` 2014-08-25 * Feature: List contents of archive: `Zip.list`. diff --git a/README.md b/README.md index 3ebaae7..c41e361 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Usage I chose to use *Promises* in this library. API is consistent with standard use: ```js -var Zip = require('7z'); // Name the class as you want! +var Zip = require('node-7z'); // Name the class as you want! var myTask = new Zip(); myTask.extractFull('myArchive.7z', 'destination', { p: 'myPassword' }) @@ -35,20 +35,54 @@ myTask.extractFull('myArchive.7z', 'destination', { p: 'myPassword' }) Installation ------------ -You must have the `7z` executable available in your PATH. In some GNU/Linux -distributions install the `p7zip-full`. +You must have the `7za` executable available in your PATH or in the same +directory of your `package.json` file. + +> On Debian an Ubuntu install the `p7zip-full` package. + +> On Windows use the `7za.exe` ([link here](http://netcologne.dl.sourceforge.net/project/sevenzip/7-Zip/9.20/7za920.zip)) +> binary. ``` -npm install --save 7z +npm install --save node-7z ``` API --- +> See the [7-Zip documentation](http://sevenzip.sourceforge.jp/chm/cmdline/index.htm) +> for the full list of usages and options (switches). + +### Add: `Zip.add` + +**Arguments** + * `archive` Path to the archive you want to create. + * `files` The file list to add. + * `options` An object of options (7-Zip switches). + +**Progress** + * `files` A array of all the extracted files *AND* directories. The `/` + character is used as a path separator on every platform. + +**Error** + * `err` An Error object. + + +### Delete: `Zip.delete` + +**Arguments** + * `archive` Path to the archive you want to delete files from. + * `files` The file list to delete. + * `options` An object of options (7-Zip switches). + +**Error** + * `err` An Error object. + + ### Extract: `Zip.extract` **Arguments** - * `archive` The path to the archive you want to analyse. + * `archive` The path to the archive you want to extract. * `dest` Where to extract the archive. * `options` An object of options. @@ -63,8 +97,8 @@ API ### Extract with full paths: `Zip.extractFull` **Arguments** - * `archive` The path to the archive you want to analyse. - * `dest` Where to extract the archive. + * `archive` The path to the archive you want to extract. + * `dest` Where to extract the archive (creates folders for you). * `options` An object of options. **Progress** @@ -75,21 +109,27 @@ API * `err` An Error object. -### Test integrity of archive: `Zip.test` +### List contents of archive: `Zip.list` **Arguments** * `archive` The path to the archive you want to analyse. * `options` An object of options. **Progress** - * `files` A array of all the extracted files *AND* directories. The `/` - character is used as a path separator on every platform. + * `files` A array of objects of all the extracted files *AND* directories. + The `/` character is used as a path separator on every platform. Object's + properties are: `date`, `attr`, `size` and `name`. + +**Fulfill** + * `spec` An object of tech spec about the archive. Properties are: `path`, + `type`, `method`, `physicalSize` and `headersSize` (Some of them may be + missing with non-7z archives). **Error** * `err` An Error object. -### List contents of archive: `Zip.list` +### Test integrity of archive: `Zip.test` **Arguments** * `archive` The path to the archive you want to analyse. @@ -99,9 +139,20 @@ API * `files` A array of all the extracted files *AND* directories. The `/` character is used as a path separator on every platform. -**Fulfill** - * `spec` An object of tech spec about the archive. Properties are: `date`, - `attr`, `size` and `name`. +**Error** + * `err` An Error object. + + +### Update: `Zip.update` + +**Arguments** + * `archive` Path to the archive you want to update. + * `files` The file list to update. + * `options` An object of options (7-Zip switches). + +**Progress** + * `files` A array of all the extracted files *AND* directories. The `/` + character is used as a path separator on every platform. **Error** * `err` An Error object. diff --git a/package.json b/package.json index d52a638..5094a0d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-7z", - "version": "0.0.3", + "version": "0.1.0", "description": "A Node.js wrapper for 7-Zip", "main": "lib/index.js", "scripts": {