tar 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.travis.yml CHANGED
@@ -1,3 +1,4 @@
1
1
  language: node_js
2
2
  node_js:
3
- - 0.6
3
+ - 0.10
4
+ - 0.11
@@ -1,11 +1,19 @@
1
1
  var tar = require("../tar.js")
2
2
  , fs = require("fs")
3
3
 
4
+
5
+ function onError(err) {
6
+ console.error('An error occurred:', err)
7
+ }
8
+
9
+ function onEnd() {
10
+ console.log('Extracted!')
11
+ }
12
+
13
+ var extractor = tar.Extract({path: __dirname + "/extract"})
14
+ .on('error', onError)
15
+ .on('end', onEnd);
16
+
4
17
  fs.createReadStream(__dirname + "/../test/fixtures/c.tar")
5
- .pipe(tar.Extract({ path: __dirname + "/extract" }))
6
- .on("error", function (er) {
7
- console.error("error here")
8
- })
9
- .on("end", function () {
10
- console.error("done")
11
- })
18
+ .on('error', onError)
19
+ .pipe(extractor);
@@ -2,9 +2,23 @@ var tar = require("../tar.js")
2
2
  , fstream = require("fstream")
3
3
  , fs = require("fs")
4
4
 
5
- var dir_destination = fs.createWriteStream('dir.tar')
5
+ var dirDest = fs.createWriteStream('dir.tar')
6
+
7
+
8
+ function onError(err) {
9
+ console.error('An error occurred:', err)
10
+ }
11
+
12
+ function onEnd() {
13
+ console.log('Packed!')
14
+ }
15
+
16
+ var packer = tar.Pack({ noProprietary: true })
17
+ .on('error', onError)
18
+ .on('end', onEnd);
6
19
 
7
20
  // This must be a "directory"
8
21
  fstream.Reader({ path: __dirname, type: "Directory" })
9
- .pipe(tar.Pack({ noProprietary: true }))
10
- .pipe(dir_destination)
22
+ .on('error', onError)
23
+ .pipe(packer)
24
+ .pipe(dirDest)
package/lib/extract.js CHANGED
@@ -57,6 +57,10 @@ function Extract (opts) {
57
57
  me.resume()
58
58
  })
59
59
 
60
+ this._fst.on('error', function(err) {
61
+ me.emit('error', err)
62
+ })
63
+
60
64
  // this._fst.on("end", function () {
61
65
  // console.error("\nEEEE Extract End", me._fst.path)
62
66
  // })
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
3
3
  "name": "tar",
4
4
  "description": "tar for node",
5
- "version": "1.0.1",
5
+ "version": "1.0.2",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git://github.com/isaacs/node-tar.git"
@@ -19,7 +19,8 @@
19
19
  "devDependencies": {
20
20
  "graceful-fs": "^3.0.2",
21
21
  "rimraf": "1.x",
22
- "tap": "0.x"
22
+ "tap": "0.x",
23
+ "mkdirp": "^0.5.0"
23
24
  },
24
25
  "license": "BSD"
25
26
  }
package/test/extract.js CHANGED
@@ -118,7 +118,7 @@ var tap = require("tap")
118
118
  linkpath: undefined,
119
119
  nlink: 2 },
120
120
  { path: '/200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL',
121
- mode: '120755',
121
+ mode: '120777',
122
122
  type: 'SymbolicLink',
123
123
  depth: 1,
124
124
  size: 200,