Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorForrest L Norvell <forrest@npmjs.com>2014-10-31 12:12:42 +0300
committerForrest L Norvell <forrest@npmjs.com>2014-10-31 12:12:42 +0300
commit254f0e4adaf2c56e9df25c7343c43b0b0804a3b5 (patch)
treef8cd796eef210b7ff03b6be64e23861667072c89 /node_modules/tar
parent4072e97856bf1e7affb38333d080c172767eea27 (diff)
tar@1.0.2
Cleaner error handling.
Diffstat (limited to 'node_modules/tar')
-rw-r--r--node_modules/tar/.travis.yml3
-rw-r--r--node_modules/tar/examples/extracter.js22
-rw-r--r--node_modules/tar/examples/packer.js20
-rw-r--r--node_modules/tar/lib/extract.js4
-rw-r--r--node_modules/tar/package.json23
-rw-r--r--node_modules/tar/test/extract.js2
6 files changed, 51 insertions, 23 deletions
diff --git a/node_modules/tar/.travis.yml b/node_modules/tar/.travis.yml
index 2d26206d5..fca8ef019 100644
--- a/node_modules/tar/.travis.yml
+++ b/node_modules/tar/.travis.yml
@@ -1,3 +1,4 @@
language: node_js
node_js:
- - 0.6
+ - 0.10
+ - 0.11
diff --git a/node_modules/tar/examples/extracter.js b/node_modules/tar/examples/extracter.js
index e150abf25..f6253a72c 100644
--- a/node_modules/tar/examples/extracter.js
+++ b/node_modules/tar/examples/extracter.js
@@ -1,11 +1,19 @@
var tar = require("../tar.js")
, fs = require("fs")
+
+function onError(err) {
+ console.error('An error occurred:', err)
+}
+
+function onEnd() {
+ console.log('Extracted!')
+}
+
+var extractor = tar.Extract({path: __dirname + "/extract"})
+ .on('error', onError)
+ .on('end', onEnd);
+
fs.createReadStream(__dirname + "/../test/fixtures/c.tar")
- .pipe(tar.Extract({ path: __dirname + "/extract" }))
- .on("error", function (er) {
- console.error("error here")
- })
- .on("end", function () {
- console.error("done")
- })
+ .on('error', onError)
+ .pipe(extractor);
diff --git a/node_modules/tar/examples/packer.js b/node_modules/tar/examples/packer.js
index ebe38926e..039969ce3 100644
--- a/node_modules/tar/examples/packer.js
+++ b/node_modules/tar/examples/packer.js
@@ -2,9 +2,23 @@ var tar = require("../tar.js")
, fstream = require("fstream")
, fs = require("fs")
-var dir_destination = fs.createWriteStream('dir.tar')
+var dirDest = fs.createWriteStream('dir.tar')
+
+
+function onError(err) {
+ console.error('An error occurred:', err)
+}
+
+function onEnd() {
+ console.log('Packed!')
+}
+
+var packer = tar.Pack({ noProprietary: true })
+ .on('error', onError)
+ .on('end', onEnd);
// This must be a "directory"
fstream.Reader({ path: __dirname, type: "Directory" })
- .pipe(tar.Pack({ noProprietary: true }))
- .pipe(dir_destination) \ No newline at end of file
+ .on('error', onError)
+ .pipe(packer)
+ .pipe(dirDest)
diff --git a/node_modules/tar/lib/extract.js b/node_modules/tar/lib/extract.js
index c34a81e21..68ff89c08 100644
--- a/node_modules/tar/lib/extract.js
+++ b/node_modules/tar/lib/extract.js
@@ -57,6 +57,10 @@ function Extract (opts) {
me.resume()
})
+ this._fst.on('error', function(err) {
+ me.emit('error', err)
+ })
+
// this._fst.on("end", function () {
// console.error("\nEEEE Extract End", me._fst.path)
// })
diff --git a/node_modules/tar/package.json b/node_modules/tar/package.json
index 207eaa1fd..7942f9df3 100644
--- a/node_modules/tar/package.json
+++ b/node_modules/tar/package.json
@@ -6,7 +6,7 @@
},
"name": "tar",
"description": "tar for node",
- "version": "1.0.1",
+ "version": "1.0.2",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-tar.git"
@@ -23,18 +23,20 @@
"devDependencies": {
"graceful-fs": "^3.0.2",
"rimraf": "1.x",
- "tap": "0.x"
+ "tap": "0.x",
+ "mkdirp": "^0.5.0"
},
"license": "BSD",
- "gitHead": "476bf6f5882b9c33d1cbf66f175d0f25e3981044",
+ "gitHead": "f31811bfa4ed1d1a89c380c65595ac92474dd84d",
"bugs": {
"url": "https://github.com/isaacs/node-tar/issues"
},
"homepage": "https://github.com/isaacs/node-tar",
- "_id": "tar@1.0.1",
- "_shasum": "6075b5a1f236defe0c7e3756d3d9b3ebdad0f19a",
- "_from": "tar@1.0.1",
- "_npmVersion": "1.4.23",
+ "_id": "tar@1.0.2",
+ "_shasum": "8b0f6740f9946259de26a3ed9c9a22890dff023f",
+ "_from": "tar@>=1.0.2 <1.1.0",
+ "_npmVersion": "2.1.3",
+ "_nodeVersion": "0.10.31",
"_npmUser": {
"name": "isaacs",
"email": "i@izs.me"
@@ -46,10 +48,9 @@
}
],
"dist": {
- "shasum": "6075b5a1f236defe0c7e3756d3d9b3ebdad0f19a",
- "tarball": "http://registry.npmjs.org/tar/-/tar-1.0.1.tgz"
+ "shasum": "8b0f6740f9946259de26a3ed9c9a22890dff023f",
+ "tarball": "http://registry.npmjs.org/tar/-/tar-1.0.2.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/tar/-/tar-1.0.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/tar/-/tar-1.0.2.tgz"
}
diff --git a/node_modules/tar/test/extract.js b/node_modules/tar/test/extract.js
index a68144be9..eca4e7cc9 100644
--- a/node_modules/tar/test/extract.js
+++ b/node_modules/tar/test/extract.js
@@ -118,7 +118,7 @@ var tap = require("tap")
linkpath: undefined,
nlink: 2 },
{ path: '/200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL',
- mode: '120755',
+ mode: '120777',
type: 'SymbolicLink',
depth: 1,
size: 200,