fsevents 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fsevents might be problematic. Click here for more details.
- package/node_modules/node-pre-gyp/CHANGELOG.md +9 -0
- package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +32 -0
- package/node_modules/node-pre-gyp/node_modules/mkdirp/node_modules/minimist/package.json +2 -1
- package/node_modules/node-pre-gyp/node_modules/nopt/README.md +8 -7
- package/node_modules/node-pre-gyp/node_modules/nopt/package.json +16 -12
- package/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/core-util-is/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/inherits/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/rc/lib/utils.js +2 -2
- package/node_modules/node-pre-gyp/node_modules/rc/node_modules/minimist/index.js +14 -2
- package/node_modules/node-pre-gyp/node_modules/rc/node_modules/minimist/package.json +10 -9
- package/node_modules/node-pre-gyp/node_modules/rc/node_modules/minimist/test/bool.js +23 -0
- package/node_modules/node-pre-gyp/node_modules/rc/node_modules/minimist/test/kv_short.js +16 -0
- package/node_modules/node-pre-gyp/node_modules/rc/package.json +9 -8
- package/node_modules/node-pre-gyp/node_modules/request/.travis.yml +1 -0
- package/node_modules/node-pre-gyp/node_modules/request/CHANGELOG.md +22 -2
- package/node_modules/node-pre-gyp/node_modules/request/README.md +42 -10
- package/node_modules/node-pre-gyp/node_modules/request/index.js +4 -0
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/aws-sign2/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/{form-data/node_modules/async/LICENSE → bl/node_modules/readable-stream/node_modules/process-nextick-args/license.md} +6 -6
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json +10 -9
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js +7 -0
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json +2 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/bl/package.json +2 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/caseless/package.json +2 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/extend/package.json +2 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/forever-agent/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/form-data/Readme.md +44 -9
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/form-data/lib/form_data.js +48 -25
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +13 -7
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/form-data/node_modules/async/package.json +26 -11
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/form-data/package.json +29 -20
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/README.md +4 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.js +35 -11
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.min.js +5 -5
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/debuggability.js +2 -0
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/direct_resolve.js +2 -0
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promise.js +5 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promisify.js +10 -5
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/using.js +14 -3
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/package.json +9 -8
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/chalk/index.js +2 -2
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json +22 -15
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/chalk/readme.md +3 -2
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/commander/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml +6 -2
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md +3 -2
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js +7 -10
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json +24 -20
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js +11 -13
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json +11 -10
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml +3 -2
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js +39 -28
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/boom/package.json +11 -12
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore +18 -18
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml +8 -5
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md +2 -0
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json +24 -28
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js +57 -63
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml +2 -2
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE +0 -0
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/README.md +16 -6
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png +0 -0
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js +0 -0
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js +24 -8
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/package.json +13 -13
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js +0 -0
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js +866 -778
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js +0 -0
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js +0 -0
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js +0 -0
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/sntp/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/package.json +2 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/isstream/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/mime-types/HISTORY.md +24 -0
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/mime-types/index.js +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md +33 -0
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json +50 -0
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json +12 -13
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/mime-types/package.json +9 -10
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/node-uuid/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/.npmignore +0 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/.travis.yml +3 -2
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/CHANGELOG.md +13 -2
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/README.md +11 -4
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/bower.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/component.json +15 -0
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/dist/qs.js +523 -0
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/lib/parse.js +3 -2
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/lib/stringify.js +28 -7
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/package.json +20 -18
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/test/parse.js +14 -14
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/test/stringify.js +23 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/stringstream/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/package.json +12 -12
- package/node_modules/node-pre-gyp/node_modules/request/request.js +51 -30
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/inherits/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/package.json +3 -2
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/package.json +2 -1
- package/node_modules/node-pre-gyp/node_modules/rimraf/package.json +9 -8
- package/node_modules/node-pre-gyp/node_modules/rimraf/rimraf.js +1 -1
- package/node_modules/node-pre-gyp/node_modules/semver/package.json +10 -12
- package/node_modules/node-pre-gyp/node_modules/semver/semver.js +1 -0
- package/node_modules/node-pre-gyp/node_modules/semver/test/index.js +21 -8
- package/node_modules/node-pre-gyp/node_modules/tar/lib/entry.js +7 -0
- package/node_modules/node-pre-gyp/node_modules/tar/lib/parse.js +5 -1
- package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/fs.js +21 -11
- package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js +208 -115
- package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/legacy-streams.js +118 -0
- package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/package.json +18 -17
- package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/polyfills.js +130 -133
- package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/package.json +18 -14
- package/node_modules/node-pre-gyp/node_modules/tar/node_modules/inherits/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/tar/package.json +22 -15
- package/node_modules/node-pre-gyp/node_modules/tar/test/parse-discard.js +29 -0
- package/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/fstream-ignore/node_modules/inherits/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/fstream-ignore/node_modules/minimatch/node_modules/lru-cache/README.md +12 -2
- package/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/fstream-ignore/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +48 -4
- package/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/fstream-ignore/node_modules/minimatch/node_modules/lru-cache/package.json +9 -9
- package/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/fstream-ignore/node_modules/minimatch/node_modules/lru-cache/test/basic.js +26 -25
- package/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/fstream-ignore/node_modules/minimatch/node_modules/lru-cache/test/serialize.js +216 -0
- package/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/readable-stream/package.json +1 -1
- package/node_modules/node-pre-gyp/package.json +10 -10
- package/package.json +2 -2
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/form-data/node_modules/async/.jscsrc +0 -3
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md +0 -81
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/form-data/node_modules/async/README.md +0 -1789
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js +0 -53
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile +0 -9
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js +0 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile +0 -8
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/index.js +0 -1
- package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/.npmignore +0 -1
- package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/LICENSE +0 -15
- package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/max-open.js +0 -69
- package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/open.js +0 -39
- package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/readdir-sort.js +0 -20
- package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/write-then-read.js +0 -47
@@ -8,18 +8,118 @@ process.cwd = function() {
|
|
8
8
|
cwd = origCwd.call(process)
|
9
9
|
return cwd
|
10
10
|
}
|
11
|
+
try {
|
12
|
+
process.cwd()
|
13
|
+
} catch (er) {}
|
14
|
+
|
11
15
|
var chdir = process.chdir
|
12
16
|
process.chdir = function(d) {
|
13
17
|
cwd = null
|
14
18
|
chdir.call(process, d)
|
15
19
|
}
|
16
20
|
|
17
|
-
|
21
|
+
module.exports = patch
|
22
|
+
|
23
|
+
function patch (fs) {
|
24
|
+
// (re-)implement some things that are known busted or missing.
|
25
|
+
|
26
|
+
// lchmod, broken prior to 0.6.2
|
27
|
+
// back-port the fix here.
|
28
|
+
if (constants.hasOwnProperty('O_SYMLINK') &&
|
29
|
+
process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
30
|
+
patchLchmod(fs)
|
31
|
+
}
|
32
|
+
|
33
|
+
// lutimes implementation, or no-op
|
34
|
+
if (!fs.lutimes) {
|
35
|
+
patchLutimes(fs)
|
36
|
+
}
|
37
|
+
|
38
|
+
// https://github.com/isaacs/node-graceful-fs/issues/4
|
39
|
+
// Chown should not fail on einval or eperm if non-root.
|
40
|
+
// It should not fail on enosys ever, as this just indicates
|
41
|
+
// that a fs doesn't support the intended operation.
|
42
|
+
|
43
|
+
fs.chown = chownFix(fs.chown)
|
44
|
+
fs.fchown = chownFix(fs.fchown)
|
45
|
+
fs.lchown = chownFix(fs.lchown)
|
46
|
+
|
47
|
+
fs.chmod = chownFix(fs.chmod)
|
48
|
+
fs.fchmod = chownFix(fs.fchmod)
|
49
|
+
fs.lchmod = chownFix(fs.lchmod)
|
50
|
+
|
51
|
+
fs.chownSync = chownFixSync(fs.chownSync)
|
52
|
+
fs.fchownSync = chownFixSync(fs.fchownSync)
|
53
|
+
fs.lchownSync = chownFixSync(fs.lchownSync)
|
54
|
+
|
55
|
+
fs.chmodSync = chownFix(fs.chmodSync)
|
56
|
+
fs.fchmodSync = chownFix(fs.fchmodSync)
|
57
|
+
fs.lchmodSync = chownFix(fs.lchmodSync)
|
18
58
|
|
19
|
-
// lchmod,
|
20
|
-
|
21
|
-
|
22
|
-
|
59
|
+
// if lchmod/lchown do not exist, then make them no-ops
|
60
|
+
if (!fs.lchmod) {
|
61
|
+
fs.lchmod = function (path, mode, cb) {
|
62
|
+
process.nextTick(cb)
|
63
|
+
}
|
64
|
+
fs.lchmodSync = function () {}
|
65
|
+
}
|
66
|
+
if (!fs.lchown) {
|
67
|
+
fs.lchown = function (path, uid, gid, cb) {
|
68
|
+
process.nextTick(cb)
|
69
|
+
}
|
70
|
+
fs.lchownSync = function () {}
|
71
|
+
}
|
72
|
+
|
73
|
+
// on Windows, A/V software can lock the directory, causing this
|
74
|
+
// to fail with an EACCES or EPERM if the directory contains newly
|
75
|
+
// created files. Try again on failure, for up to 1 second.
|
76
|
+
if (process.platform === "win32") {
|
77
|
+
fs.rename = (function (fs$rename) { return function (from, to, cb) {
|
78
|
+
var start = Date.now()
|
79
|
+
fs$rename(from, to, function CB (er) {
|
80
|
+
if (er
|
81
|
+
&& (er.code === "EACCES" || er.code === "EPERM")
|
82
|
+
&& Date.now() - start < 1000) {
|
83
|
+
return fs$rename(from, to, CB)
|
84
|
+
}
|
85
|
+
if (cb) cb(er)
|
86
|
+
})
|
87
|
+
}})(fs.rename)
|
88
|
+
}
|
89
|
+
|
90
|
+
// if read() returns EAGAIN, then just try it again.
|
91
|
+
fs.read = (function (fs$read) { return function (fd, buffer, offset, length, position, callback_) {
|
92
|
+
var callback
|
93
|
+
if (callback_ && typeof callback_ === 'function') {
|
94
|
+
var eagCounter = 0
|
95
|
+
callback = function (er, _, __) {
|
96
|
+
if (er && er.code === 'EAGAIN' && eagCounter < 10) {
|
97
|
+
eagCounter ++
|
98
|
+
return fs$read.call(fs, fd, buffer, offset, length, position, callback)
|
99
|
+
}
|
100
|
+
callback_.apply(this, arguments)
|
101
|
+
}
|
102
|
+
}
|
103
|
+
return fs$read.call(fs, fd, buffer, offset, length, position, callback)
|
104
|
+
}})(fs.read)
|
105
|
+
|
106
|
+
fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
|
107
|
+
var eagCounter = 0
|
108
|
+
while (true) {
|
109
|
+
try {
|
110
|
+
return fs$readSync.call(fs, fd, buffer, offset, length, position)
|
111
|
+
} catch (er) {
|
112
|
+
if (er.code === 'EAGAIN' && eagCounter < 10) {
|
113
|
+
eagCounter ++
|
114
|
+
continue
|
115
|
+
}
|
116
|
+
throw er
|
117
|
+
}
|
118
|
+
}
|
119
|
+
}})(fs.readSync)
|
120
|
+
}
|
121
|
+
|
122
|
+
function patchLchmod (fs) {
|
23
123
|
fs.lchmod = function (path, mode, callback) {
|
24
124
|
callback = callback || noop
|
25
125
|
fs.open( path
|
@@ -45,25 +145,25 @@ if (constants.hasOwnProperty('O_SYMLINK') &&
|
|
45
145
|
|
46
146
|
// prefer to return the chmod error, if one occurs,
|
47
147
|
// but still try to close, and report closing errors if they occur.
|
48
|
-
var
|
49
|
-
|
50
|
-
var ret = fs.fchmodSync(fd, mode)
|
51
|
-
} catch (er) {
|
52
|
-
err = er
|
53
|
-
}
|
148
|
+
var threw = true
|
149
|
+
var ret
|
54
150
|
try {
|
55
|
-
fs.
|
56
|
-
|
57
|
-
|
151
|
+
ret = fs.fchmodSync(fd, mode)
|
152
|
+
threw = false
|
153
|
+
} finally {
|
154
|
+
if (threw) {
|
155
|
+
try {
|
156
|
+
fs.closeSync(fd)
|
157
|
+
} catch (er) {}
|
158
|
+
} else {
|
159
|
+
fs.closeSync(fd)
|
160
|
+
}
|
58
161
|
}
|
59
|
-
if (err || err2) throw (err || err2)
|
60
162
|
return ret
|
61
163
|
}
|
62
164
|
}
|
63
165
|
|
64
|
-
|
65
|
-
// lutimes implementation, or no-op
|
66
|
-
if (!fs.lutimes) {
|
166
|
+
function patchLutimes (fs) {
|
67
167
|
if (constants.hasOwnProperty("O_SYMLINK")) {
|
68
168
|
fs.lutimes = function (path, at, mt, cb) {
|
69
169
|
fs.open(path, constants.O_SYMLINK, function (er, fd) {
|
@@ -79,62 +179,29 @@ if (!fs.lutimes) {
|
|
79
179
|
|
80
180
|
fs.lutimesSync = function (path, at, mt) {
|
81
181
|
var fd = fs.openSync(path, constants.O_SYMLINK)
|
82
|
-
|
83
|
-
|
84
|
-
, ret
|
85
|
-
|
182
|
+
var ret
|
183
|
+
var threw = true
|
86
184
|
try {
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
185
|
+
ret = fs.futimesSync(fd, at, mt)
|
186
|
+
threw = false
|
187
|
+
} finally {
|
188
|
+
if (threw) {
|
189
|
+
try {
|
190
|
+
fs.closeSync(fd)
|
191
|
+
} catch (er) {}
|
192
|
+
} else {
|
193
|
+
fs.closeSync(fd)
|
194
|
+
}
|
95
195
|
}
|
96
|
-
if (err || err2) throw (err || err2)
|
97
196
|
return ret
|
98
197
|
}
|
99
198
|
|
100
|
-
} else if (fs.utimensat && constants.hasOwnProperty("AT_SYMLINK_NOFOLLOW")) {
|
101
|
-
// maybe utimensat will be bound soonish?
|
102
|
-
fs.lutimes = function (path, at, mt, cb) {
|
103
|
-
fs.utimensat(path, at, mt, constants.AT_SYMLINK_NOFOLLOW, cb)
|
104
|
-
}
|
105
|
-
|
106
|
-
fs.lutimesSync = function (path, at, mt) {
|
107
|
-
return fs.utimensatSync(path, at, mt, constants.AT_SYMLINK_NOFOLLOW)
|
108
|
-
}
|
109
|
-
|
110
199
|
} else {
|
111
200
|
fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) }
|
112
201
|
fs.lutimesSync = function () {}
|
113
202
|
}
|
114
203
|
}
|
115
204
|
|
116
|
-
|
117
|
-
// https://github.com/isaacs/node-graceful-fs/issues/4
|
118
|
-
// Chown should not fail on einval or eperm if non-root.
|
119
|
-
// It should not fail on enosys ever, as this just indicates
|
120
|
-
// that a fs doesn't support the intended operation.
|
121
|
-
|
122
|
-
fs.chown = chownFix(fs.chown)
|
123
|
-
fs.fchown = chownFix(fs.fchown)
|
124
|
-
fs.lchown = chownFix(fs.lchown)
|
125
|
-
|
126
|
-
fs.chmod = chownFix(fs.chmod)
|
127
|
-
fs.fchmod = chownFix(fs.fchmod)
|
128
|
-
fs.lchmod = chownFix(fs.lchmod)
|
129
|
-
|
130
|
-
fs.chownSync = chownFixSync(fs.chownSync)
|
131
|
-
fs.fchownSync = chownFixSync(fs.fchownSync)
|
132
|
-
fs.lchownSync = chownFixSync(fs.lchownSync)
|
133
|
-
|
134
|
-
fs.chmodSync = chownFix(fs.chmodSync)
|
135
|
-
fs.fchmodSync = chownFix(fs.fchmodSync)
|
136
|
-
fs.lchmodSync = chownFix(fs.lchmodSync)
|
137
|
-
|
138
205
|
function chownFix (orig) {
|
139
206
|
if (!orig) return orig
|
140
207
|
return function (target, uid, gid, cb) {
|
@@ -183,73 +250,3 @@ function chownErOk (er) {
|
|
183
250
|
|
184
251
|
return false
|
185
252
|
}
|
186
|
-
|
187
|
-
|
188
|
-
// if lchmod/lchown do not exist, then make them no-ops
|
189
|
-
if (!fs.lchmod) {
|
190
|
-
fs.lchmod = function (path, mode, cb) {
|
191
|
-
process.nextTick(cb)
|
192
|
-
}
|
193
|
-
fs.lchmodSync = function () {}
|
194
|
-
}
|
195
|
-
if (!fs.lchown) {
|
196
|
-
fs.lchown = function (path, uid, gid, cb) {
|
197
|
-
process.nextTick(cb)
|
198
|
-
}
|
199
|
-
fs.lchownSync = function () {}
|
200
|
-
}
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
// on Windows, A/V software can lock the directory, causing this
|
205
|
-
// to fail with an EACCES or EPERM if the directory contains newly
|
206
|
-
// created files. Try again on failure, for up to 1 second.
|
207
|
-
if (process.platform === "win32") {
|
208
|
-
var rename_ = fs.rename
|
209
|
-
fs.rename = function rename (from, to, cb) {
|
210
|
-
var start = Date.now()
|
211
|
-
rename_(from, to, function CB (er) {
|
212
|
-
if (er
|
213
|
-
&& (er.code === "EACCES" || er.code === "EPERM")
|
214
|
-
&& Date.now() - start < 1000) {
|
215
|
-
return rename_(from, to, CB)
|
216
|
-
}
|
217
|
-
if(cb) cb(er)
|
218
|
-
})
|
219
|
-
}
|
220
|
-
}
|
221
|
-
|
222
|
-
|
223
|
-
// if read() returns EAGAIN, then just try it again.
|
224
|
-
var read = fs.read
|
225
|
-
fs.read = function (fd, buffer, offset, length, position, callback_) {
|
226
|
-
var callback
|
227
|
-
if (callback_ && typeof callback_ === 'function') {
|
228
|
-
var eagCounter = 0
|
229
|
-
callback = function (er, _, __) {
|
230
|
-
if (er && er.code === 'EAGAIN' && eagCounter < 10) {
|
231
|
-
eagCounter ++
|
232
|
-
return read.call(fs, fd, buffer, offset, length, position, callback)
|
233
|
-
}
|
234
|
-
callback_.apply(this, arguments)
|
235
|
-
}
|
236
|
-
}
|
237
|
-
return read.call(fs, fd, buffer, offset, length, position, callback)
|
238
|
-
}
|
239
|
-
|
240
|
-
var readSync = fs.readSync
|
241
|
-
fs.readSync = function (fd, buffer, offset, length, position) {
|
242
|
-
var eagCounter = 0
|
243
|
-
while (true) {
|
244
|
-
try {
|
245
|
-
return readSync.call(fs, fd, buffer, offset, length, position)
|
246
|
-
} catch (er) {
|
247
|
-
if (er.code === 'EAGAIN' && eagCounter < 10) {
|
248
|
-
eagCounter ++
|
249
|
-
continue
|
250
|
-
}
|
251
|
-
throw er
|
252
|
-
}
|
253
|
-
}
|
254
|
-
}
|
255
|
-
|
@@ -6,7 +6,7 @@
|
|
6
6
|
},
|
7
7
|
"name": "fstream",
|
8
8
|
"description": "Advanced file system stream things",
|
9
|
-
"version": "1.0.
|
9
|
+
"version": "1.0.8",
|
10
10
|
"repository": {
|
11
11
|
"type": "git",
|
12
12
|
"url": "git://github.com/isaacs/fstream.git"
|
@@ -16,7 +16,7 @@
|
|
16
16
|
"node": ">=0.6"
|
17
17
|
},
|
18
18
|
"dependencies": {
|
19
|
-
"graceful-fs": "
|
19
|
+
"graceful-fs": "^4.1.2",
|
20
20
|
"inherits": "~2.0.0",
|
21
21
|
"mkdirp": ">=0.5 0",
|
22
22
|
"rimraf": "2"
|
@@ -29,25 +29,29 @@
|
|
29
29
|
"test": "standard && tap examples/*.js"
|
30
30
|
},
|
31
31
|
"license": "ISC",
|
32
|
-
"gitHead": "
|
32
|
+
"gitHead": "d9f81146c50e687f1df04c1a0e7e4c173eb3dae2",
|
33
33
|
"bugs": {
|
34
34
|
"url": "https://github.com/isaacs/fstream/issues"
|
35
35
|
},
|
36
36
|
"homepage": "https://github.com/isaacs/fstream#readme",
|
37
|
-
"_id": "fstream@1.0.
|
38
|
-
"_shasum": "
|
37
|
+
"_id": "fstream@1.0.8",
|
38
|
+
"_shasum": "7e8d7a73abb3647ef36e4b8a15ca801dba03d038",
|
39
39
|
"_from": "fstream@^1.0.2",
|
40
|
-
"_npmVersion": "2.
|
41
|
-
"_nodeVersion": "2.
|
40
|
+
"_npmVersion": "2.14.3",
|
41
|
+
"_nodeVersion": "2.2.2",
|
42
42
|
"_npmUser": {
|
43
|
-
"name": "
|
44
|
-
"email": "
|
43
|
+
"name": "zkat",
|
44
|
+
"email": "kat@sykosomatic.org"
|
45
45
|
},
|
46
46
|
"dist": {
|
47
|
-
"shasum": "
|
48
|
-
"tarball": "http://registry.npmjs.org/fstream/-/fstream-1.0.
|
47
|
+
"shasum": "7e8d7a73abb3647ef36e4b8a15ca801dba03d038",
|
48
|
+
"tarball": "http://registry.npmjs.org/fstream/-/fstream-1.0.8.tgz"
|
49
49
|
},
|
50
50
|
"maintainers": [
|
51
|
+
{
|
52
|
+
"name": "iarna",
|
53
|
+
"email": "me@re-becca.org"
|
54
|
+
},
|
51
55
|
{
|
52
56
|
"name": "isaacs",
|
53
57
|
"email": "isaacs@npmjs.com"
|
@@ -57,11 +61,11 @@
|
|
57
61
|
"email": "ogd@aoaioxxysz.net"
|
58
62
|
},
|
59
63
|
{
|
60
|
-
"name": "
|
61
|
-
"email": "
|
64
|
+
"name": "zkat",
|
65
|
+
"email": "kat@sykosomatic.org"
|
62
66
|
}
|
63
67
|
],
|
64
68
|
"directories": {},
|
65
|
-
"_resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.
|
69
|
+
"_resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.8.tgz",
|
66
70
|
"readme": "ERROR: No README data found!"
|
67
71
|
}
|
@@ -6,7 +6,7 @@
|
|
6
6
|
},
|
7
7
|
"name": "tar",
|
8
8
|
"description": "tar for node",
|
9
|
-
"version": "2.
|
9
|
+
"version": "2.2.1",
|
10
10
|
"repository": {
|
11
11
|
"type": "git",
|
12
12
|
"url": "git://github.com/isaacs/node-tar.git"
|
@@ -21,41 +21,48 @@
|
|
21
21
|
"inherits": "2"
|
22
22
|
},
|
23
23
|
"devDependencies": {
|
24
|
-
"graceful-fs": "^
|
24
|
+
"graceful-fs": "^4.1.2",
|
25
25
|
"rimraf": "1.x",
|
26
26
|
"tap": "0.x",
|
27
27
|
"mkdirp": "^0.5.0"
|
28
28
|
},
|
29
29
|
"license": "ISC",
|
30
|
-
"gitHead": "
|
30
|
+
"gitHead": "52237e39d2eb68d22a32d9a98f1d762189fe6a3d",
|
31
31
|
"bugs": {
|
32
32
|
"url": "https://github.com/isaacs/node-tar/issues"
|
33
33
|
},
|
34
34
|
"homepage": "https://github.com/isaacs/node-tar#readme",
|
35
|
-
"_id": "tar@2.
|
36
|
-
"_shasum": "
|
37
|
-
"_from": "tar@~2.
|
38
|
-
"_npmVersion": "2.
|
39
|
-
"_nodeVersion": "
|
35
|
+
"_id": "tar@2.2.1",
|
36
|
+
"_shasum": "8e4d2a256c0e2185c6b18ad694aec968b83cb1d1",
|
37
|
+
"_from": "tar@~2.2.0",
|
38
|
+
"_npmVersion": "2.14.3",
|
39
|
+
"_nodeVersion": "2.2.2",
|
40
40
|
"_npmUser": {
|
41
|
-
"name": "
|
42
|
-
"email": "
|
41
|
+
"name": "zkat",
|
42
|
+
"email": "kat@sykosomatic.org"
|
43
43
|
},
|
44
44
|
"dist": {
|
45
|
-
"shasum": "
|
46
|
-
"tarball": "http://registry.npmjs.org/tar/-/tar-2.
|
45
|
+
"shasum": "8e4d2a256c0e2185c6b18ad694aec968b83cb1d1",
|
46
|
+
"tarball": "http://registry.npmjs.org/tar/-/tar-2.2.1.tgz"
|
47
47
|
},
|
48
48
|
"maintainers": [
|
49
49
|
{
|
50
50
|
"name": "isaacs",
|
51
|
-
"email": "
|
51
|
+
"email": "isaacs@npmjs.com"
|
52
52
|
},
|
53
53
|
{
|
54
54
|
"name": "othiym23",
|
55
55
|
"email": "ogd@aoaioxxysz.net"
|
56
|
+
},
|
57
|
+
{
|
58
|
+
"name": "soldair",
|
59
|
+
"email": "soldair@gmail.com"
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"name": "zkat",
|
63
|
+
"email": "kat@sykosomatic.org"
|
56
64
|
}
|
57
65
|
],
|
58
66
|
"directories": {},
|
59
|
-
"_resolved": "https://registry.npmjs.org/tar/-/tar-2.
|
60
|
-
"readme": "ERROR: No README data found!"
|
67
|
+
"_resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz"
|
61
68
|
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
var tap = require("tap")
|
2
|
+
, tar = require("../tar.js")
|
3
|
+
, fs = require("fs")
|
4
|
+
, path = require("path")
|
5
|
+
, file = path.resolve(__dirname, "fixtures/c.tar")
|
6
|
+
|
7
|
+
tap.test("parser test", function (t) {
|
8
|
+
var parser = tar.Parse()
|
9
|
+
var total = 0
|
10
|
+
var dataTotal = 0
|
11
|
+
|
12
|
+
parser.on("end", function () {
|
13
|
+
|
14
|
+
t.equals(total-513,dataTotal,'should have discarded only c.txt')
|
15
|
+
|
16
|
+
t.end()
|
17
|
+
})
|
18
|
+
|
19
|
+
fs.createReadStream(file)
|
20
|
+
.pipe(parser)
|
21
|
+
.on('entry',function(entry){
|
22
|
+
if(entry.path === 'c.txt') entry.abort()
|
23
|
+
|
24
|
+
total += entry.size;
|
25
|
+
entry.on('data',function(data){
|
26
|
+
dataTotal += data.length
|
27
|
+
})
|
28
|
+
})
|
29
|
+
})
|
@@ -36,7 +36,7 @@ away.
|
|
36
36
|
* `length` Function that is used to calculate the length of stored
|
37
37
|
items. If you're storing strings or buffers, then you probably want
|
38
38
|
to do something like `function(n){return n.length}`. The default is
|
39
|
-
`function(n){return 1}`, which is fine if you want to store `
|
39
|
+
`function(n){return 1}`, which is fine if you want to store `max`
|
40
40
|
like-sized things.
|
41
41
|
* `dispose` Function that is called on items when they are dropped
|
42
42
|
from the cache. This can be handy if you want to close file
|
@@ -102,8 +102,18 @@ away.
|
|
102
102
|
Return total length of objects in cache taking into account
|
103
103
|
`length` options function.
|
104
104
|
|
105
|
-
* `itemCount
|
105
|
+
* `itemCount`
|
106
106
|
|
107
107
|
Return total quantity of objects currently in cache. Note, that
|
108
108
|
`stale` (see options) items are returned as part of this item
|
109
109
|
count.
|
110
|
+
|
111
|
+
* `dump()`
|
112
|
+
|
113
|
+
Return an array of the cache entries ready for serialization and usage
|
114
|
+
with 'destinationCache.load(arr)`.
|
115
|
+
|
116
|
+
* `load(cacheEntriesArray)`
|
117
|
+
|
118
|
+
Loads another cache entries array, obtained with `sourceCache.dump()`,
|
119
|
+
into the cache. The destination cache is reset before loading new entries
|
@@ -137,10 +137,24 @@ LRUCache.prototype.reset = function () {
|
|
137
137
|
this._itemCount = 0
|
138
138
|
}
|
139
139
|
|
140
|
-
// Provided for debugging/dev purposes only. No promises whatsoever that
|
141
|
-
// this API stays stable.
|
142
140
|
LRUCache.prototype.dump = function () {
|
143
|
-
|
141
|
+
var arr = []
|
142
|
+
var i = 0
|
143
|
+
|
144
|
+
for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
|
145
|
+
var hit = this._lruList[k]
|
146
|
+
if (!isStale(this, hit)) {
|
147
|
+
//Do not store staled hits
|
148
|
+
++i
|
149
|
+
arr.push({
|
150
|
+
k: hit.key,
|
151
|
+
v: hit.value,
|
152
|
+
e: hit.now + (hit.maxAge || 0)
|
153
|
+
});
|
154
|
+
}
|
155
|
+
}
|
156
|
+
//arr has the most read first
|
157
|
+
return arr
|
144
158
|
}
|
145
159
|
|
146
160
|
LRUCache.prototype.dumpLru = function () {
|
@@ -150,8 +164,13 @@ LRUCache.prototype.dumpLru = function () {
|
|
150
164
|
LRUCache.prototype.set = function (key, value, maxAge) {
|
151
165
|
maxAge = maxAge || this._maxAge
|
152
166
|
var now = maxAge ? Date.now() : 0
|
167
|
+
var len = this._lengthCalculator(value)
|
153
168
|
|
154
169
|
if (hOP(this._cache, key)) {
|
170
|
+
if (len > this._max) {
|
171
|
+
del(this, this._cache[key])
|
172
|
+
return false
|
173
|
+
}
|
155
174
|
// dispose of the old one before overwriting
|
156
175
|
if (this._dispose)
|
157
176
|
this._dispose(key, this._cache[key].value)
|
@@ -159,11 +178,16 @@ LRUCache.prototype.set = function (key, value, maxAge) {
|
|
159
178
|
this._cache[key].now = now
|
160
179
|
this._cache[key].maxAge = maxAge
|
161
180
|
this._cache[key].value = value
|
181
|
+
this._length += (len - this._cache[key].length)
|
182
|
+
this._cache[key].length = len
|
162
183
|
this.get(key)
|
184
|
+
|
185
|
+
if (this._length > this._max)
|
186
|
+
trim(this)
|
187
|
+
|
163
188
|
return true
|
164
189
|
}
|
165
190
|
|
166
|
-
var len = this._lengthCalculator(value)
|
167
191
|
var hit = new Entry(key, value, this._mru++, len, now, maxAge)
|
168
192
|
|
169
193
|
// oversized objects fall out of cache automatically.
|
@@ -209,6 +233,26 @@ LRUCache.prototype.del = function (key) {
|
|
209
233
|
del(this, this._cache[key])
|
210
234
|
}
|
211
235
|
|
236
|
+
LRUCache.prototype.load = function (arr) {
|
237
|
+
//reset the cache
|
238
|
+
this.reset();
|
239
|
+
|
240
|
+
var now = Date.now()
|
241
|
+
//A previous serialized cache has the most recent items first
|
242
|
+
for (var l = arr.length - 1; l >= 0; l-- ) {
|
243
|
+
var hit = arr[l]
|
244
|
+
var expiresAt = hit.e || 0
|
245
|
+
if (expiresAt === 0) {
|
246
|
+
//the item was created without expiration in a non aged cache
|
247
|
+
this.set(hit.k, hit.v)
|
248
|
+
} else {
|
249
|
+
var maxAge = expiresAt - now
|
250
|
+
//dont add already expired items
|
251
|
+
if (maxAge > 0) this.set(hit.k, hit.v, maxAge)
|
252
|
+
}
|
253
|
+
}
|
254
|
+
}
|
255
|
+
|
212
256
|
function get (self, key, doUse) {
|
213
257
|
var hit = self._cache[key]
|
214
258
|
if (hit) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "lru-cache",
|
3
3
|
"description": "A cache object that deletes the least-recently-used items.",
|
4
|
-
"version": "2.
|
4
|
+
"version": "2.7.0",
|
5
5
|
"author": {
|
6
6
|
"name": "Isaac Z. Schlueter",
|
7
7
|
"email": "i@izs.me"
|
@@ -24,23 +24,23 @@
|
|
24
24
|
"weak": ""
|
25
25
|
},
|
26
26
|
"license": "ISC",
|
27
|
-
"gitHead": "
|
27
|
+
"gitHead": "fc6ee93093f4e463e5946736d4c48adc013724d1",
|
28
28
|
"bugs": {
|
29
29
|
"url": "https://github.com/isaacs/node-lru-cache/issues"
|
30
30
|
},
|
31
31
|
"homepage": "https://github.com/isaacs/node-lru-cache#readme",
|
32
|
-
"_id": "lru-cache@2.
|
33
|
-
"_shasum": "
|
32
|
+
"_id": "lru-cache@2.7.0",
|
33
|
+
"_shasum": "aaa376a4cd970f9cebf5ec1909566ec034f07ee6",
|
34
34
|
"_from": "lru-cache@2",
|
35
|
-
"_npmVersion": "3.
|
36
|
-
"_nodeVersion": "
|
35
|
+
"_npmVersion": "3.3.2",
|
36
|
+
"_nodeVersion": "4.0.0",
|
37
37
|
"_npmUser": {
|
38
38
|
"name": "isaacs",
|
39
39
|
"email": "isaacs@npmjs.com"
|
40
40
|
},
|
41
41
|
"dist": {
|
42
|
-
"shasum": "
|
43
|
-
"tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.
|
42
|
+
"shasum": "aaa376a4cd970f9cebf5ec1909566ec034f07ee6",
|
43
|
+
"tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.7.0.tgz"
|
44
44
|
},
|
45
45
|
"maintainers": [
|
46
46
|
{
|
@@ -53,6 +53,6 @@
|
|
53
53
|
}
|
54
54
|
],
|
55
55
|
"directories": {},
|
56
|
-
"_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.
|
56
|
+
"_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.0.tgz",
|
57
57
|
"readme": "ERROR: No README data found!"
|
58
58
|
}
|