fsevents 1.0.6 → 1.0.7
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.
Potentially problematic release.
This version of fsevents might be problematic. Click here for more details.
- package/node_modules/are-we-there-yet/LICENSE +5 -0
- package/node_modules/are-we-there-yet/README.md +2 -1
- package/node_modules/are-we-there-yet/README.md~ +183 -0
- package/node_modules/are-we-there-yet/package.json +10 -9
- package/node_modules/async/README.md +14 -10
- package/node_modules/async/dist/async.js +22 -18
- package/node_modules/async/dist/async.min.js +1 -1
- package/node_modules/async/lib/async.js +22 -18
- package/node_modules/async/package.json +11 -10
- package/node_modules/core-util-is/package.json +2 -1
- package/node_modules/dashdash/README.md +6 -3
- package/node_modules/dashdash/lib/dashdash.js +10 -1
- package/node_modules/dashdash/package.json +9 -8
- package/node_modules/escape-string-regexp/index.js +1 -1
- package/node_modules/escape-string-regexp/package.json +17 -15
- package/node_modules/escape-string-regexp/readme.md +4 -4
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +9 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +42 -30
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +9 -9
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +28 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json +11 -11
- package/node_modules/graceful-fs/package.json +2 -3
- package/node_modules/isarray/package.json +2 -1
- package/node_modules/mime-db/HISTORY.md +32 -0
- package/node_modules/mime-db/README.md +1 -1
- package/node_modules/mime-db/db.json +78 -0
- package/node_modules/mime-db/package.json +15 -14
- package/node_modules/mime-types/HISTORY.md +12 -0
- package/node_modules/mime-types/package.json +11 -10
- package/node_modules/node-pre-gyp/CHANGELOG.md +8 -0
- package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +32 -0
- package/node_modules/node-pre-gyp/package.json +8 -8
- package/node_modules/{bl/node_modules/readable-stream/node_modules/process-nextick-args → process-nextick-args}/.travis.yml +6 -1
- package/node_modules/{bl/node_modules/readable-stream/node_modules/process-nextick-args → process-nextick-args}/index.js +8 -1
- package/node_modules/{bl/node_modules/readable-stream/node_modules/process-nextick-args → process-nextick-args}/package.json +13 -12
- package/node_modules/rc/lib/utils.js +1 -1
- package/node_modules/rc/package.json +11 -10
- package/node_modules/readable-stream/README.md +27 -6
- package/node_modules/{bl/node_modules/readable-stream → readable-stream}/doc/stream.markdown +608 -574
- package/node_modules/readable-stream/lib/_stream_duplex.js +18 -25
- package/node_modules/readable-stream/lib/_stream_passthrough.js +2 -21
- package/node_modules/readable-stream/lib/_stream_readable.js +117 -93
- package/node_modules/readable-stream/lib/_stream_transform.js +15 -27
- package/node_modules/readable-stream/lib/_stream_writable.js +140 -88
- package/node_modules/readable-stream/package.json +33 -25
- package/node_modules/readable-stream/readable.js +6 -1
- package/node_modules/rimraf/README.md +58 -0
- package/node_modules/rimraf/node_modules/glob/README.md +27 -45
- package/node_modules/rimraf/node_modules/glob/common.js +7 -26
- package/node_modules/rimraf/node_modules/glob/node_modules/inherits/package.json +1 -1
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +9 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +42 -30
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +9 -9
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +28 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +11 -11
- package/node_modules/rimraf/node_modules/glob/package.json +11 -10
- package/node_modules/rimraf/package.json +12 -11
- package/node_modules/rimraf/rimraf.js +7 -5
- package/node_modules/sshpk/bin/sshpk-conv +1 -1
- package/node_modules/sshpk/lib/dhe.js +1 -2
- package/node_modules/sshpk/lib/ssh-buffer.js +2 -1
- package/node_modules/sshpk/package.json +13 -11
- package/node_modules/string_decoder/package.json +2 -1
- package/node_modules/tar-pack/index.js +1 -2
- package/node_modules/tar-pack/node_modules/rimraf/LICENSE +12 -20
- package/node_modules/tar-pack/node_modules/rimraf/README.md +17 -4
- package/node_modules/tar-pack/node_modules/rimraf/bin.js +11 -4
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/README.md +359 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/common.js +226 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/glob.js +752 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/.eslintrc +17 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/LICENSE +15 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/README.md +37 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/inflight.js +44 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE +15 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/README.md +36 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +58 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/test/basic.js +51 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/wrappy.js +33 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/package.json +67 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/test.js +97 -0
- package/node_modules/{bl/node_modules/readable-stream → tar-pack/node_modules/rimraf/node_modules/glob}/node_modules/inherits/package.json +3 -3
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/README.md +216 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/minimatch.js +912 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +3 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +122 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +8 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +191 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +2 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml +3 -0
- package/node_modules/tar-pack/node_modules/{readable-stream/node_modules/isarray/README.md → rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md} +0 -33
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +6 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +89 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +5 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +50 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +79 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +84 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml +4 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE +18 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +62 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js +6 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +13 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +90 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js +39 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +81 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/package.json +66 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/README.md +51 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE +15 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/README.md +36 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/package.json +58 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js +51 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js +33 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/once.js +21 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/package.json +70 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/index.js +20 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/package.json +78 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/readme.md +51 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/package.json +79 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/sync.js +460 -0
- package/node_modules/tar-pack/node_modules/rimraf/package.json +28 -40
- package/node_modules/tar-pack/node_modules/rimraf/rimraf.js +138 -53
- package/node_modules/tar-pack/package.json +21 -11
- package/node_modules/tunnel-agent/index.js +2 -0
- package/node_modules/tunnel-agent/package.json +10 -9
- package/node_modules/{bl/node_modules/readable-stream/node_modules/util-deprecate → util-deprecate}/package.json +3 -2
- package/node_modules/verror/package.json +3 -2
- package/package.json +2 -2
- package/CHANGELOG.md +0 -16
- package/node_modules/bl/node_modules/readable-stream/.npmignore +0 -5
- package/node_modules/bl/node_modules/readable-stream/LICENSE +0 -18
- package/node_modules/bl/node_modules/readable-stream/README.md +0 -36
- package/node_modules/bl/node_modules/readable-stream/duplex.js +0 -1
- package/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js +0 -82
- package/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js +0 -27
- package/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js +0 -973
- package/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js +0 -197
- package/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js +0 -527
- package/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/LICENSE +0 -19
- package/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md +0 -3
- package/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch +0 -604
- package/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +0 -107
- package/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json +0 -67
- package/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/test.js +0 -68
- package/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md +0 -54
- package/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js +0 -209
- package/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json +0 -19
- package/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js +0 -3
- package/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json +0 -59
- package/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore +0 -2
- package/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE +0 -20
- package/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md +0 -7
- package/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js +0 -221
- package/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json +0 -60
- package/node_modules/bl/node_modules/readable-stream/package.json +0 -82
- package/node_modules/bl/node_modules/readable-stream/passthrough.js +0 -1
- package/node_modules/bl/node_modules/readable-stream/readable.js +0 -12
- package/node_modules/bl/node_modules/readable-stream/transform.js +0 -1
- package/node_modules/bl/node_modules/readable-stream/writable.js +0 -1
- package/node_modules/node-pre-gyp/LICENSE +0 -27
- package/node_modules/readable-stream/float.patch +0 -923
- package/node_modules/tar-pack/node_modules/readable-stream/.npmignore +0 -5
- package/node_modules/tar-pack/node_modules/readable-stream/LICENSE +0 -18
- package/node_modules/tar-pack/node_modules/readable-stream/README.md +0 -15
- package/node_modules/tar-pack/node_modules/readable-stream/duplex.js +0 -1
- package/node_modules/tar-pack/node_modules/readable-stream/lib/_stream_duplex.js +0 -89
- package/node_modules/tar-pack/node_modules/readable-stream/lib/_stream_passthrough.js +0 -46
- package/node_modules/tar-pack/node_modules/readable-stream/lib/_stream_readable.js +0 -982
- package/node_modules/tar-pack/node_modules/readable-stream/lib/_stream_transform.js +0 -210
- package/node_modules/tar-pack/node_modules/readable-stream/lib/_stream_writable.js +0 -386
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/LICENSE +0 -19
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/README.md +0 -3
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/float.patch +0 -604
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +0 -107
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/package.json +0 -67
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/test.js +0 -68
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/inherits/LICENSE +0 -16
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/inherits/README.md +0 -42
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/inherits/inherits.js +0 -1
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/inherits/inherits_browser.js +0 -23
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/inherits/package.json +0 -58
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/inherits/test.js +0 -25
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/isarray/build/build.js +0 -209
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/isarray/component.json +0 -19
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/isarray/index.js +0 -3
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/isarray/package.json +0 -59
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/string_decoder/.npmignore +0 -2
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/string_decoder/LICENSE +0 -20
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/string_decoder/README.md +0 -7
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/string_decoder/index.js +0 -221
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/string_decoder/package.json +0 -60
- package/node_modules/tar-pack/node_modules/readable-stream/package.json +0 -76
- package/node_modules/tar-pack/node_modules/readable-stream/passthrough.js +0 -1
- package/node_modules/tar-pack/node_modules/readable-stream/readable.js +0 -8
- package/node_modules/tar-pack/node_modules/readable-stream/transform.js +0 -1
- package/node_modules/tar-pack/node_modules/readable-stream/writable.js +0 -1
- package/node_modules/tar-pack/node_modules/rimraf/AUTHORS +0 -6
- package/node_modules/tar-pack/node_modules/rimraf/test/run.sh +0 -16
- package/node_modules/tar-pack/node_modules/rimraf/test/setup.sh +0 -47
- package/node_modules/tar-pack/node_modules/rimraf/test/test-async.js +0 -5
- package/node_modules/tar-pack/node_modules/rimraf/test/test-sync.js +0 -3
- /package/node_modules/{bl/node_modules/readable-stream/node_modules/process-nextick-args → process-nextick-args}/license.md +0 -0
- /package/node_modules/{bl/node_modules/readable-stream/node_modules/process-nextick-args → process-nextick-args}/readme.md +0 -0
- /package/node_modules/{bl/node_modules/readable-stream/node_modules/process-nextick-args → process-nextick-args}/test.js +0 -0
- /package/node_modules/{bl/node_modules/readable-stream → readable-stream}/.travis.yml +0 -0
- /package/node_modules/{bl/node_modules/readable-stream → readable-stream}/.zuul.yml +0 -0
- /package/node_modules/{bl/node_modules/readable-stream → readable-stream}/doc/wg-meetings/2015-01-30.md +0 -0
- /package/node_modules/{bl/node_modules/readable-stream → tar-pack/node_modules/rimraf/node_modules/glob}/node_modules/inherits/LICENSE +0 -0
- /package/node_modules/{bl/node_modules/readable-stream → tar-pack/node_modules/rimraf/node_modules/glob}/node_modules/inherits/README.md +0 -0
- /package/node_modules/{bl/node_modules/readable-stream → tar-pack/node_modules/rimraf/node_modules/glob}/node_modules/inherits/inherits.js +0 -0
- /package/node_modules/{bl/node_modules/readable-stream → tar-pack/node_modules/rimraf/node_modules/glob}/node_modules/inherits/inherits_browser.js +0 -0
- /package/node_modules/{bl/node_modules/readable-stream → tar-pack/node_modules/rimraf/node_modules/glob}/node_modules/inherits/test.js +0 -0
- /package/node_modules/{bl/node_modules/readable-stream/node_modules/util-deprecate → util-deprecate}/History.md +0 -0
- /package/node_modules/{bl/node_modules/readable-stream/node_modules/util-deprecate → util-deprecate}/LICENSE +0 -0
- /package/node_modules/{bl/node_modules/readable-stream/node_modules/util-deprecate → util-deprecate}/README.md +0 -0
- /package/node_modules/{bl/node_modules/readable-stream/node_modules/util-deprecate → util-deprecate}/browser.js +0 -0
- /package/node_modules/{bl/node_modules/readable-stream/node_modules/util-deprecate → util-deprecate}/node.js +0 -0
@@ -1,527 +0,0 @@
|
|
1
|
-
// A bit simpler than readable streams.
|
2
|
-
// Implement an async ._write(chunk, encoding, cb), and it'll handle all
|
3
|
-
// the drain event emission and buffering.
|
4
|
-
|
5
|
-
'use strict';
|
6
|
-
|
7
|
-
module.exports = Writable;
|
8
|
-
|
9
|
-
/*<replacement>*/
|
10
|
-
var processNextTick = require('process-nextick-args');
|
11
|
-
/*</replacement>*/
|
12
|
-
|
13
|
-
|
14
|
-
/*<replacement>*/
|
15
|
-
var Buffer = require('buffer').Buffer;
|
16
|
-
/*</replacement>*/
|
17
|
-
|
18
|
-
Writable.WritableState = WritableState;
|
19
|
-
|
20
|
-
|
21
|
-
/*<replacement>*/
|
22
|
-
var util = require('core-util-is');
|
23
|
-
util.inherits = require('inherits');
|
24
|
-
/*</replacement>*/
|
25
|
-
|
26
|
-
|
27
|
-
/*<replacement>*/
|
28
|
-
var internalUtil = {
|
29
|
-
deprecate: require('util-deprecate')
|
30
|
-
};
|
31
|
-
/*</replacement>*/
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
/*<replacement>*/
|
36
|
-
var Stream;
|
37
|
-
(function (){try{
|
38
|
-
Stream = require('st' + 'ream');
|
39
|
-
}catch(_){}finally{
|
40
|
-
if (!Stream)
|
41
|
-
Stream = require('events').EventEmitter;
|
42
|
-
}}())
|
43
|
-
/*</replacement>*/
|
44
|
-
|
45
|
-
var Buffer = require('buffer').Buffer;
|
46
|
-
|
47
|
-
util.inherits(Writable, Stream);
|
48
|
-
|
49
|
-
function nop() {}
|
50
|
-
|
51
|
-
function WriteReq(chunk, encoding, cb) {
|
52
|
-
this.chunk = chunk;
|
53
|
-
this.encoding = encoding;
|
54
|
-
this.callback = cb;
|
55
|
-
this.next = null;
|
56
|
-
}
|
57
|
-
|
58
|
-
function WritableState(options, stream) {
|
59
|
-
var Duplex = require('./_stream_duplex');
|
60
|
-
|
61
|
-
options = options || {};
|
62
|
-
|
63
|
-
// object stream flag to indicate whether or not this stream
|
64
|
-
// contains buffers or objects.
|
65
|
-
this.objectMode = !!options.objectMode;
|
66
|
-
|
67
|
-
if (stream instanceof Duplex)
|
68
|
-
this.objectMode = this.objectMode || !!options.writableObjectMode;
|
69
|
-
|
70
|
-
// the point at which write() starts returning false
|
71
|
-
// Note: 0 is a valid value, means that we always return false if
|
72
|
-
// the entire buffer is not flushed immediately on write()
|
73
|
-
var hwm = options.highWaterMark;
|
74
|
-
var defaultHwm = this.objectMode ? 16 : 16 * 1024;
|
75
|
-
this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;
|
76
|
-
|
77
|
-
// cast to ints.
|
78
|
-
this.highWaterMark = ~~this.highWaterMark;
|
79
|
-
|
80
|
-
this.needDrain = false;
|
81
|
-
// at the start of calling end()
|
82
|
-
this.ending = false;
|
83
|
-
// when end() has been called, and returned
|
84
|
-
this.ended = false;
|
85
|
-
// when 'finish' is emitted
|
86
|
-
this.finished = false;
|
87
|
-
|
88
|
-
// should we decode strings into buffers before passing to _write?
|
89
|
-
// this is here so that some node-core streams can optimize string
|
90
|
-
// handling at a lower level.
|
91
|
-
var noDecode = options.decodeStrings === false;
|
92
|
-
this.decodeStrings = !noDecode;
|
93
|
-
|
94
|
-
// Crypto is kind of old and crusty. Historically, its default string
|
95
|
-
// encoding is 'binary' so we have to make this configurable.
|
96
|
-
// Everything else in the universe uses 'utf8', though.
|
97
|
-
this.defaultEncoding = options.defaultEncoding || 'utf8';
|
98
|
-
|
99
|
-
// not an actual buffer we keep track of, but a measurement
|
100
|
-
// of how much we're waiting to get pushed to some underlying
|
101
|
-
// socket or file.
|
102
|
-
this.length = 0;
|
103
|
-
|
104
|
-
// a flag to see when we're in the middle of a write.
|
105
|
-
this.writing = false;
|
106
|
-
|
107
|
-
// when true all writes will be buffered until .uncork() call
|
108
|
-
this.corked = 0;
|
109
|
-
|
110
|
-
// a flag to be able to tell if the onwrite cb is called immediately,
|
111
|
-
// or on a later tick. We set this to true at first, because any
|
112
|
-
// actions that shouldn't happen until "later" should generally also
|
113
|
-
// not happen before the first write call.
|
114
|
-
this.sync = true;
|
115
|
-
|
116
|
-
// a flag to know if we're processing previously buffered items, which
|
117
|
-
// may call the _write() callback in the same tick, so that we don't
|
118
|
-
// end up in an overlapped onwrite situation.
|
119
|
-
this.bufferProcessing = false;
|
120
|
-
|
121
|
-
// the callback that's passed to _write(chunk,cb)
|
122
|
-
this.onwrite = function(er) {
|
123
|
-
onwrite(stream, er);
|
124
|
-
};
|
125
|
-
|
126
|
-
// the callback that the user supplies to write(chunk,encoding,cb)
|
127
|
-
this.writecb = null;
|
128
|
-
|
129
|
-
// the amount that is being written when _write is called.
|
130
|
-
this.writelen = 0;
|
131
|
-
|
132
|
-
this.bufferedRequest = null;
|
133
|
-
this.lastBufferedRequest = null;
|
134
|
-
|
135
|
-
// number of pending user-supplied write callbacks
|
136
|
-
// this must be 0 before 'finish' can be emitted
|
137
|
-
this.pendingcb = 0;
|
138
|
-
|
139
|
-
// emit prefinish if the only thing we're waiting for is _write cbs
|
140
|
-
// This is relevant for synchronous Transform streams
|
141
|
-
this.prefinished = false;
|
142
|
-
|
143
|
-
// True if the error was already emitted and should not be thrown again
|
144
|
-
this.errorEmitted = false;
|
145
|
-
}
|
146
|
-
|
147
|
-
WritableState.prototype.getBuffer = function writableStateGetBuffer() {
|
148
|
-
var current = this.bufferedRequest;
|
149
|
-
var out = [];
|
150
|
-
while (current) {
|
151
|
-
out.push(current);
|
152
|
-
current = current.next;
|
153
|
-
}
|
154
|
-
return out;
|
155
|
-
};
|
156
|
-
|
157
|
-
(function (){try {
|
158
|
-
Object.defineProperty(WritableState.prototype, 'buffer', {
|
159
|
-
get: internalUtil.deprecate(function() {
|
160
|
-
return this.getBuffer();
|
161
|
-
}, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' +
|
162
|
-
'instead.')
|
163
|
-
});
|
164
|
-
}catch(_){}}());
|
165
|
-
|
166
|
-
|
167
|
-
function Writable(options) {
|
168
|
-
var Duplex = require('./_stream_duplex');
|
169
|
-
|
170
|
-
// Writable ctor is applied to Duplexes, though they're not
|
171
|
-
// instanceof Writable, they're instanceof Readable.
|
172
|
-
if (!(this instanceof Writable) && !(this instanceof Duplex))
|
173
|
-
return new Writable(options);
|
174
|
-
|
175
|
-
this._writableState = new WritableState(options, this);
|
176
|
-
|
177
|
-
// legacy.
|
178
|
-
this.writable = true;
|
179
|
-
|
180
|
-
if (options) {
|
181
|
-
if (typeof options.write === 'function')
|
182
|
-
this._write = options.write;
|
183
|
-
|
184
|
-
if (typeof options.writev === 'function')
|
185
|
-
this._writev = options.writev;
|
186
|
-
}
|
187
|
-
|
188
|
-
Stream.call(this);
|
189
|
-
}
|
190
|
-
|
191
|
-
// Otherwise people can pipe Writable streams, which is just wrong.
|
192
|
-
Writable.prototype.pipe = function() {
|
193
|
-
this.emit('error', new Error('Cannot pipe. Not readable.'));
|
194
|
-
};
|
195
|
-
|
196
|
-
|
197
|
-
function writeAfterEnd(stream, cb) {
|
198
|
-
var er = new Error('write after end');
|
199
|
-
// TODO: defer error events consistently everywhere, not just the cb
|
200
|
-
stream.emit('error', er);
|
201
|
-
processNextTick(cb, er);
|
202
|
-
}
|
203
|
-
|
204
|
-
// If we get something that is not a buffer, string, null, or undefined,
|
205
|
-
// and we're not in objectMode, then that's an error.
|
206
|
-
// Otherwise stream chunks are all considered to be of length=1, and the
|
207
|
-
// watermarks determine how many objects to keep in the buffer, rather than
|
208
|
-
// how many bytes or characters.
|
209
|
-
function validChunk(stream, state, chunk, cb) {
|
210
|
-
var valid = true;
|
211
|
-
|
212
|
-
if (!(Buffer.isBuffer(chunk)) &&
|
213
|
-
typeof chunk !== 'string' &&
|
214
|
-
chunk !== null &&
|
215
|
-
chunk !== undefined &&
|
216
|
-
!state.objectMode) {
|
217
|
-
var er = new TypeError('Invalid non-string/buffer chunk');
|
218
|
-
stream.emit('error', er);
|
219
|
-
processNextTick(cb, er);
|
220
|
-
valid = false;
|
221
|
-
}
|
222
|
-
return valid;
|
223
|
-
}
|
224
|
-
|
225
|
-
Writable.prototype.write = function(chunk, encoding, cb) {
|
226
|
-
var state = this._writableState;
|
227
|
-
var ret = false;
|
228
|
-
|
229
|
-
if (typeof encoding === 'function') {
|
230
|
-
cb = encoding;
|
231
|
-
encoding = null;
|
232
|
-
}
|
233
|
-
|
234
|
-
if (Buffer.isBuffer(chunk))
|
235
|
-
encoding = 'buffer';
|
236
|
-
else if (!encoding)
|
237
|
-
encoding = state.defaultEncoding;
|
238
|
-
|
239
|
-
if (typeof cb !== 'function')
|
240
|
-
cb = nop;
|
241
|
-
|
242
|
-
if (state.ended)
|
243
|
-
writeAfterEnd(this, cb);
|
244
|
-
else if (validChunk(this, state, chunk, cb)) {
|
245
|
-
state.pendingcb++;
|
246
|
-
ret = writeOrBuffer(this, state, chunk, encoding, cb);
|
247
|
-
}
|
248
|
-
|
249
|
-
return ret;
|
250
|
-
};
|
251
|
-
|
252
|
-
Writable.prototype.cork = function() {
|
253
|
-
var state = this._writableState;
|
254
|
-
|
255
|
-
state.corked++;
|
256
|
-
};
|
257
|
-
|
258
|
-
Writable.prototype.uncork = function() {
|
259
|
-
var state = this._writableState;
|
260
|
-
|
261
|
-
if (state.corked) {
|
262
|
-
state.corked--;
|
263
|
-
|
264
|
-
if (!state.writing &&
|
265
|
-
!state.corked &&
|
266
|
-
!state.finished &&
|
267
|
-
!state.bufferProcessing &&
|
268
|
-
state.bufferedRequest)
|
269
|
-
clearBuffer(this, state);
|
270
|
-
}
|
271
|
-
};
|
272
|
-
|
273
|
-
Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
|
274
|
-
// node::ParseEncoding() requires lower case.
|
275
|
-
if (typeof encoding === 'string')
|
276
|
-
encoding = encoding.toLowerCase();
|
277
|
-
if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64',
|
278
|
-
'ucs2', 'ucs-2','utf16le', 'utf-16le', 'raw']
|
279
|
-
.indexOf((encoding + '').toLowerCase()) > -1))
|
280
|
-
throw new TypeError('Unknown encoding: ' + encoding);
|
281
|
-
this._writableState.defaultEncoding = encoding;
|
282
|
-
};
|
283
|
-
|
284
|
-
function decodeChunk(state, chunk, encoding) {
|
285
|
-
if (!state.objectMode &&
|
286
|
-
state.decodeStrings !== false &&
|
287
|
-
typeof chunk === 'string') {
|
288
|
-
chunk = new Buffer(chunk, encoding);
|
289
|
-
}
|
290
|
-
return chunk;
|
291
|
-
}
|
292
|
-
|
293
|
-
// if we're already writing something, then just put this
|
294
|
-
// in the queue, and wait our turn. Otherwise, call _write
|
295
|
-
// If we return false, then we need a drain event, so set that flag.
|
296
|
-
function writeOrBuffer(stream, state, chunk, encoding, cb) {
|
297
|
-
chunk = decodeChunk(state, chunk, encoding);
|
298
|
-
|
299
|
-
if (Buffer.isBuffer(chunk))
|
300
|
-
encoding = 'buffer';
|
301
|
-
var len = state.objectMode ? 1 : chunk.length;
|
302
|
-
|
303
|
-
state.length += len;
|
304
|
-
|
305
|
-
var ret = state.length < state.highWaterMark;
|
306
|
-
// we must ensure that previous needDrain will not be reset to false.
|
307
|
-
if (!ret)
|
308
|
-
state.needDrain = true;
|
309
|
-
|
310
|
-
if (state.writing || state.corked) {
|
311
|
-
var last = state.lastBufferedRequest;
|
312
|
-
state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);
|
313
|
-
if (last) {
|
314
|
-
last.next = state.lastBufferedRequest;
|
315
|
-
} else {
|
316
|
-
state.bufferedRequest = state.lastBufferedRequest;
|
317
|
-
}
|
318
|
-
} else {
|
319
|
-
doWrite(stream, state, false, len, chunk, encoding, cb);
|
320
|
-
}
|
321
|
-
|
322
|
-
return ret;
|
323
|
-
}
|
324
|
-
|
325
|
-
function doWrite(stream, state, writev, len, chunk, encoding, cb) {
|
326
|
-
state.writelen = len;
|
327
|
-
state.writecb = cb;
|
328
|
-
state.writing = true;
|
329
|
-
state.sync = true;
|
330
|
-
if (writev)
|
331
|
-
stream._writev(chunk, state.onwrite);
|
332
|
-
else
|
333
|
-
stream._write(chunk, encoding, state.onwrite);
|
334
|
-
state.sync = false;
|
335
|
-
}
|
336
|
-
|
337
|
-
function onwriteError(stream, state, sync, er, cb) {
|
338
|
-
--state.pendingcb;
|
339
|
-
if (sync)
|
340
|
-
processNextTick(cb, er);
|
341
|
-
else
|
342
|
-
cb(er);
|
343
|
-
|
344
|
-
stream._writableState.errorEmitted = true;
|
345
|
-
stream.emit('error', er);
|
346
|
-
}
|
347
|
-
|
348
|
-
function onwriteStateUpdate(state) {
|
349
|
-
state.writing = false;
|
350
|
-
state.writecb = null;
|
351
|
-
state.length -= state.writelen;
|
352
|
-
state.writelen = 0;
|
353
|
-
}
|
354
|
-
|
355
|
-
function onwrite(stream, er) {
|
356
|
-
var state = stream._writableState;
|
357
|
-
var sync = state.sync;
|
358
|
-
var cb = state.writecb;
|
359
|
-
|
360
|
-
onwriteStateUpdate(state);
|
361
|
-
|
362
|
-
if (er)
|
363
|
-
onwriteError(stream, state, sync, er, cb);
|
364
|
-
else {
|
365
|
-
// Check if we're actually ready to finish, but don't emit yet
|
366
|
-
var finished = needFinish(state);
|
367
|
-
|
368
|
-
if (!finished &&
|
369
|
-
!state.corked &&
|
370
|
-
!state.bufferProcessing &&
|
371
|
-
state.bufferedRequest) {
|
372
|
-
clearBuffer(stream, state);
|
373
|
-
}
|
374
|
-
|
375
|
-
if (sync) {
|
376
|
-
processNextTick(afterWrite, stream, state, finished, cb);
|
377
|
-
} else {
|
378
|
-
afterWrite(stream, state, finished, cb);
|
379
|
-
}
|
380
|
-
}
|
381
|
-
}
|
382
|
-
|
383
|
-
function afterWrite(stream, state, finished, cb) {
|
384
|
-
if (!finished)
|
385
|
-
onwriteDrain(stream, state);
|
386
|
-
state.pendingcb--;
|
387
|
-
cb();
|
388
|
-
finishMaybe(stream, state);
|
389
|
-
}
|
390
|
-
|
391
|
-
// Must force callback to be called on nextTick, so that we don't
|
392
|
-
// emit 'drain' before the write() consumer gets the 'false' return
|
393
|
-
// value, and has a chance to attach a 'drain' listener.
|
394
|
-
function onwriteDrain(stream, state) {
|
395
|
-
if (state.length === 0 && state.needDrain) {
|
396
|
-
state.needDrain = false;
|
397
|
-
stream.emit('drain');
|
398
|
-
}
|
399
|
-
}
|
400
|
-
|
401
|
-
|
402
|
-
// if there's something in the buffer waiting, then process it
|
403
|
-
function clearBuffer(stream, state) {
|
404
|
-
state.bufferProcessing = true;
|
405
|
-
var entry = state.bufferedRequest;
|
406
|
-
|
407
|
-
if (stream._writev && entry && entry.next) {
|
408
|
-
// Fast case, write everything using _writev()
|
409
|
-
var buffer = [];
|
410
|
-
var cbs = [];
|
411
|
-
while (entry) {
|
412
|
-
cbs.push(entry.callback);
|
413
|
-
buffer.push(entry);
|
414
|
-
entry = entry.next;
|
415
|
-
}
|
416
|
-
|
417
|
-
// count the one we are adding, as well.
|
418
|
-
// TODO(isaacs) clean this up
|
419
|
-
state.pendingcb++;
|
420
|
-
state.lastBufferedRequest = null;
|
421
|
-
doWrite(stream, state, true, state.length, buffer, '', function(err) {
|
422
|
-
for (var i = 0; i < cbs.length; i++) {
|
423
|
-
state.pendingcb--;
|
424
|
-
cbs[i](err);
|
425
|
-
}
|
426
|
-
});
|
427
|
-
|
428
|
-
// Clear buffer
|
429
|
-
} else {
|
430
|
-
// Slow case, write chunks one-by-one
|
431
|
-
while (entry) {
|
432
|
-
var chunk = entry.chunk;
|
433
|
-
var encoding = entry.encoding;
|
434
|
-
var cb = entry.callback;
|
435
|
-
var len = state.objectMode ? 1 : chunk.length;
|
436
|
-
|
437
|
-
doWrite(stream, state, false, len, chunk, encoding, cb);
|
438
|
-
entry = entry.next;
|
439
|
-
// if we didn't call the onwrite immediately, then
|
440
|
-
// it means that we need to wait until it does.
|
441
|
-
// also, that means that the chunk and cb are currently
|
442
|
-
// being processed, so move the buffer counter past them.
|
443
|
-
if (state.writing) {
|
444
|
-
break;
|
445
|
-
}
|
446
|
-
}
|
447
|
-
|
448
|
-
if (entry === null)
|
449
|
-
state.lastBufferedRequest = null;
|
450
|
-
}
|
451
|
-
state.bufferedRequest = entry;
|
452
|
-
state.bufferProcessing = false;
|
453
|
-
}
|
454
|
-
|
455
|
-
Writable.prototype._write = function(chunk, encoding, cb) {
|
456
|
-
cb(new Error('not implemented'));
|
457
|
-
};
|
458
|
-
|
459
|
-
Writable.prototype._writev = null;
|
460
|
-
|
461
|
-
Writable.prototype.end = function(chunk, encoding, cb) {
|
462
|
-
var state = this._writableState;
|
463
|
-
|
464
|
-
if (typeof chunk === 'function') {
|
465
|
-
cb = chunk;
|
466
|
-
chunk = null;
|
467
|
-
encoding = null;
|
468
|
-
} else if (typeof encoding === 'function') {
|
469
|
-
cb = encoding;
|
470
|
-
encoding = null;
|
471
|
-
}
|
472
|
-
|
473
|
-
if (chunk !== null && chunk !== undefined)
|
474
|
-
this.write(chunk, encoding);
|
475
|
-
|
476
|
-
// .end() fully uncorks
|
477
|
-
if (state.corked) {
|
478
|
-
state.corked = 1;
|
479
|
-
this.uncork();
|
480
|
-
}
|
481
|
-
|
482
|
-
// ignore unnecessary end() calls.
|
483
|
-
if (!state.ending && !state.finished)
|
484
|
-
endWritable(this, state, cb);
|
485
|
-
};
|
486
|
-
|
487
|
-
|
488
|
-
function needFinish(state) {
|
489
|
-
return (state.ending &&
|
490
|
-
state.length === 0 &&
|
491
|
-
state.bufferedRequest === null &&
|
492
|
-
!state.finished &&
|
493
|
-
!state.writing);
|
494
|
-
}
|
495
|
-
|
496
|
-
function prefinish(stream, state) {
|
497
|
-
if (!state.prefinished) {
|
498
|
-
state.prefinished = true;
|
499
|
-
stream.emit('prefinish');
|
500
|
-
}
|
501
|
-
}
|
502
|
-
|
503
|
-
function finishMaybe(stream, state) {
|
504
|
-
var need = needFinish(state);
|
505
|
-
if (need) {
|
506
|
-
if (state.pendingcb === 0) {
|
507
|
-
prefinish(stream, state);
|
508
|
-
state.finished = true;
|
509
|
-
stream.emit('finish');
|
510
|
-
} else {
|
511
|
-
prefinish(stream, state);
|
512
|
-
}
|
513
|
-
}
|
514
|
-
return need;
|
515
|
-
}
|
516
|
-
|
517
|
-
function endWritable(stream, state, cb) {
|
518
|
-
state.ending = true;
|
519
|
-
finishMaybe(stream, state);
|
520
|
-
if (cb) {
|
521
|
-
if (state.finished)
|
522
|
-
processNextTick(cb);
|
523
|
-
else
|
524
|
-
stream.once('finish', cb);
|
525
|
-
}
|
526
|
-
state.ended = true;
|
527
|
-
}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
Copyright Node.js contributors. All rights reserved.
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
of this software and associated documentation files (the "Software"), to
|
5
|
-
deal in the Software without restriction, including without limitation the
|
6
|
-
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
7
|
-
sell copies of the Software, and to permit persons to whom the Software is
|
8
|
-
furnished to do so, subject to the following conditions:
|
9
|
-
|
10
|
-
The above copyright notice and this permission notice shall be included in
|
11
|
-
all copies or substantial portions of the Software.
|
12
|
-
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
18
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
19
|
-
IN THE SOFTWARE.
|