1111I chose to use * Promises* in this library. API is consistent with standard use:
1212
1313``` js
14- var Zip = require (' 7z' ); // Name the class as you want!
14+ var Zip = require (' node- 7z' ); // Name the class as you want!
1515var myTask = new Zip ();
1616myTask .extractFull (' myArchive.7z' , ' destination' , { p: ' myPassword' })
1717
@@ -35,20 +35,54 @@ myTask.extractFull('myArchive.7z', 'destination', { p: 'myPassword' })
3535Installation
3636------------
3737
38- You must have the ` 7z ` executable available in your PATH. In some GNU/Linux
39- distributions install the ` p7zip-full ` .
38+ You must have the ` 7za ` executable available in your PATH or in the same
39+ directory of your ` package.json ` file.
40+
41+ > On Debian an Ubuntu install the ` p7zip-full ` package.
42+
43+ > On Windows use the ` 7za.exe ` ([ link here] ( http://netcologne.dl.sourceforge.net/project/sevenzip/7-Zip/9.20/7za920.zip ) )
44+ > binary.
4045
4146```
42- npm install --save 7z
47+ npm install --save node- 7z
4348```
4449
4550API
4651---
4752
53+ > See the [ 7-Zip documentation] ( http://sevenzip.sourceforge.jp/chm/cmdline/index.htm )
54+ > for the full list of usages and options (switches).
55+
56+ ### Add: ` Zip.add `
57+
58+ ** Arguments**
59+ * ` archive ` Path to the archive you want to create.
60+ * ` files ` The file list to add.
61+ * ` options ` An object of options (7-Zip switches).
62+
63+ ** Progress**
64+ * ` files ` A array of all the extracted files * AND* directories. The ` / `
65+ character is used as a path separator on every platform.
66+
67+ ** Error**
68+ * ` err ` An Error object.
69+
70+
71+ ### Delete: ` Zip.delete `
72+
73+ ** Arguments**
74+ * ` archive ` Path to the archive you want to delete files from.
75+ * ` files ` The file list to delete.
76+ * ` options ` An object of options (7-Zip switches).
77+
78+ ** Error**
79+ * ` err ` An Error object.
80+
81+
4882### Extract: ` Zip.extract `
4983
5084** Arguments**
51- * ` archive ` The path to the archive you want to analyse .
85+ * ` archive ` The path to the archive you want to extract .
5286 * ` dest ` Where to extract the archive.
5387 * ` options ` An object of options.
5488
6397### Extract with full paths: ` Zip.extractFull `
6498
6599** Arguments**
66- * ` archive ` The path to the archive you want to analyse .
67- * ` dest ` Where to extract the archive.
100+ * ` archive ` The path to the archive you want to extract .
101+ * ` dest ` Where to extract the archive (creates folders for you) .
68102 * ` options ` An object of options.
69103
70104** Progress**
75109 * ` err ` An Error object.
76110
77111
78- ### Test integrity of archive: ` Zip.test `
112+ ### List contents of archive: ` Zip.list `
79113
80114** Arguments**
81115 * ` archive ` The path to the archive you want to analyse.
82116 * ` options ` An object of options.
83117
84118** Progress**
85- * ` files ` A array of all the extracted files * AND* directories. The ` / `
86- character is used as a path separator on every platform.
119+ * ` files ` A array of objects of all the extracted files * AND* directories.
120+ The ` / ` character is used as a path separator on every platform. Object's
121+ properties are: ` date ` , ` attr ` , ` size ` and ` name ` .
122+
123+ ** Fulfill**
124+ * ` spec ` An object of tech spec about the archive. Properties are: ` path ` ,
125+ ` type ` , ` method ` , ` physicalSize ` and ` headersSize ` (Some of them may be
126+ missing with non-7z archives).
87127
88128** Error**
89129 * ` err ` An Error object.
90130
91131
92- ### List contents of archive: ` Zip.list `
132+ ### Test integrity of archive: ` Zip.test `
93133
94134** Arguments**
95135 * ` archive ` The path to the archive you want to analyse.
99139 * ` files ` A array of all the extracted files * AND* directories. The ` / `
100140 character is used as a path separator on every platform.
101141
102- ** Fulfill**
103- * ` spec ` An object of tech spec about the archive. Properties are: ` date ` ,
104- ` attr ` , ` size ` and ` name ` .
142+ ** Error**
143+ * ` err ` An Error object.
144+
145+
146+ ### Update: ` Zip.update `
147+
148+ ** Arguments**
149+ * ` archive ` Path to the archive you want to update.
150+ * ` files ` The file list to update.
151+ * ` options ` An object of options (7-Zip switches).
152+
153+ ** Progress**
154+ * ` files ` A array of all the extracted files * AND* directories. The ` / `
155+ character is used as a path separator on every platform.
105156
106157** Error**
107158 * ` err ` An Error object.
0 commit comments