node_task 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/node_task/index.js +28 -21
- data/lib/node_task/node_modules/ndjson/cli.js +23 -0
- data/lib/node_task/node_modules/ndjson/collaborators.md +7 -0
- data/lib/node_task/node_modules/ndjson/index.js +30 -0
- data/lib/node_task/node_modules/ndjson/node_modules/minimist/example/parse.js +2 -0
- data/lib/node_task/node_modules/ndjson/node_modules/minimist/index.js +236 -0
- data/lib/node_task/node_modules/ndjson/node_modules/minimist/package.json +71 -0
- data/lib/node_task/node_modules/ndjson/node_modules/minimist/readme.markdown +91 -0
- data/lib/node_task/node_modules/ndjson/node_modules/minimist/test/all_bool.js +32 -0
- data/lib/node_task/node_modules/ndjson/node_modules/minimist/test/bool.js +166 -0
- data/lib/node_task/node_modules/ndjson/node_modules/minimist/test/dash.js +31 -0
- data/lib/node_task/node_modules/ndjson/node_modules/minimist/test/default_bool.js +35 -0
- data/lib/node_task/node_modules/ndjson/node_modules/minimist/test/dotted.js +22 -0
- data/lib/node_task/node_modules/ndjson/node_modules/minimist/test/kv_short.js +16 -0
- data/lib/node_task/node_modules/ndjson/node_modules/minimist/test/long.js +31 -0
- data/lib/node_task/node_modules/ndjson/node_modules/minimist/test/num.js +36 -0
- data/lib/node_task/node_modules/ndjson/node_modules/minimist/test/parse.js +197 -0
- data/lib/node_task/node_modules/ndjson/node_modules/minimist/test/parse_modified.js +9 -0
- data/lib/node_task/node_modules/ndjson/node_modules/minimist/test/short.js +67 -0
- data/lib/node_task/node_modules/ndjson/node_modules/minimist/test/stop_early.js +15 -0
- data/lib/node_task/node_modules/ndjson/node_modules/minimist/test/unknown.js +102 -0
- data/lib/node_task/node_modules/ndjson/node_modules/minimist/test/whitespace.js +8 -0
- data/lib/node_task/node_modules/ndjson/node_modules/split2/README.md +74 -0
- data/lib/node_task/node_modules/ndjson/node_modules/split2/index.js +83 -0
- data/lib/node_task/node_modules/ndjson/node_modules/split2/package.json +55 -0
- data/lib/node_task/node_modules/ndjson/node_modules/split2/test.js +149 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/README.md +132 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/README.md +15 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/duplex.js +1 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js +89 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js +46 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js +982 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js +210 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js +386 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/README.md +3 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/float.patch +604 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +107 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/package.json +53 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/util.js +106 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/node_modules/inherits/README.md +42 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/node_modules/inherits/inherits.js +1 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/node_modules/inherits/inherits_browser.js +23 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/node_modules/inherits/package.json +50 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/node_modules/inherits/test.js +25 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/node_modules/isarray/README.md +54 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/node_modules/isarray/build/build.js +209 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/node_modules/isarray/component.json +19 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/node_modules/isarray/index.js +3 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/node_modules/isarray/package.json +53 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/README.md +7 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/index.js +221 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/package.json +54 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/package.json +70 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/passthrough.js +1 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/readable.js +8 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/transform.js +1 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/writable.js +1 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/xtend/README.md +32 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/xtend/immutable.js +17 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/xtend/mutable.js +15 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/xtend/package.json +88 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/node_modules/xtend/test.js +63 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/package.json +65 -0
- data/lib/node_task/node_modules/ndjson/node_modules/through2/through2.js +96 -0
- data/lib/node_task/node_modules/ndjson/package.json +64 -0
- data/lib/node_task/node_modules/ndjson/readme.md +55 -0
- data/lib/node_task/node_modules/ndjson/test.js +73 -0
- data/lib/node_task/node_task.rb +6 -13
- data/lib/node_task/package.json +2 -3
- metadata +69 -3
@@ -0,0 +1,221 @@
|
|
1
|
+
// Copyright Joyent, Inc. and other Node contributors.
|
2
|
+
//
|
3
|
+
// Permission is hereby granted, free of charge, to any person obtaining a
|
4
|
+
// copy of this software and associated documentation files (the
|
5
|
+
// "Software"), to deal in the Software without restriction, including
|
6
|
+
// without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
8
|
+
// persons to whom the Software is furnished to do so, subject to the
|
9
|
+
// following conditions:
|
10
|
+
//
|
11
|
+
// The above copyright notice and this permission notice shall be included
|
12
|
+
// in all copies or substantial portions of the Software.
|
13
|
+
//
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
15
|
+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
17
|
+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
18
|
+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
19
|
+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
20
|
+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
var Buffer = require('buffer').Buffer;
|
23
|
+
|
24
|
+
var isBufferEncoding = Buffer.isEncoding
|
25
|
+
|| function(encoding) {
|
26
|
+
switch (encoding && encoding.toLowerCase()) {
|
27
|
+
case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;
|
28
|
+
default: return false;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
|
33
|
+
function assertEncoding(encoding) {
|
34
|
+
if (encoding && !isBufferEncoding(encoding)) {
|
35
|
+
throw new Error('Unknown encoding: ' + encoding);
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
// StringDecoder provides an interface for efficiently splitting a series of
|
40
|
+
// buffers into a series of JS strings without breaking apart multi-byte
|
41
|
+
// characters. CESU-8 is handled as part of the UTF-8 encoding.
|
42
|
+
//
|
43
|
+
// @TODO Handling all encodings inside a single object makes it very difficult
|
44
|
+
// to reason about this code, so it should be split up in the future.
|
45
|
+
// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
|
46
|
+
// points as used by CESU-8.
|
47
|
+
var StringDecoder = exports.StringDecoder = function(encoding) {
|
48
|
+
this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
|
49
|
+
assertEncoding(encoding);
|
50
|
+
switch (this.encoding) {
|
51
|
+
case 'utf8':
|
52
|
+
// CESU-8 represents each of Surrogate Pair by 3-bytes
|
53
|
+
this.surrogateSize = 3;
|
54
|
+
break;
|
55
|
+
case 'ucs2':
|
56
|
+
case 'utf16le':
|
57
|
+
// UTF-16 represents each of Surrogate Pair by 2-bytes
|
58
|
+
this.surrogateSize = 2;
|
59
|
+
this.detectIncompleteChar = utf16DetectIncompleteChar;
|
60
|
+
break;
|
61
|
+
case 'base64':
|
62
|
+
// Base-64 stores 3 bytes in 4 chars, and pads the remainder.
|
63
|
+
this.surrogateSize = 3;
|
64
|
+
this.detectIncompleteChar = base64DetectIncompleteChar;
|
65
|
+
break;
|
66
|
+
default:
|
67
|
+
this.write = passThroughWrite;
|
68
|
+
return;
|
69
|
+
}
|
70
|
+
|
71
|
+
// Enough space to store all bytes of a single character. UTF-8 needs 4
|
72
|
+
// bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
|
73
|
+
this.charBuffer = new Buffer(6);
|
74
|
+
// Number of bytes received for the current incomplete multi-byte character.
|
75
|
+
this.charReceived = 0;
|
76
|
+
// Number of bytes expected for the current incomplete multi-byte character.
|
77
|
+
this.charLength = 0;
|
78
|
+
};
|
79
|
+
|
80
|
+
|
81
|
+
// write decodes the given buffer and returns it as JS string that is
|
82
|
+
// guaranteed to not contain any partial multi-byte characters. Any partial
|
83
|
+
// character found at the end of the buffer is buffered up, and will be
|
84
|
+
// returned when calling write again with the remaining bytes.
|
85
|
+
//
|
86
|
+
// Note: Converting a Buffer containing an orphan surrogate to a String
|
87
|
+
// currently works, but converting a String to a Buffer (via `new Buffer`, or
|
88
|
+
// Buffer#write) will replace incomplete surrogates with the unicode
|
89
|
+
// replacement character. See https://codereview.chromium.org/121173009/ .
|
90
|
+
StringDecoder.prototype.write = function(buffer) {
|
91
|
+
var charStr = '';
|
92
|
+
// if our last write ended with an incomplete multibyte character
|
93
|
+
while (this.charLength) {
|
94
|
+
// determine how many remaining bytes this buffer has to offer for this char
|
95
|
+
var available = (buffer.length >= this.charLength - this.charReceived) ?
|
96
|
+
this.charLength - this.charReceived :
|
97
|
+
buffer.length;
|
98
|
+
|
99
|
+
// add the new bytes to the char buffer
|
100
|
+
buffer.copy(this.charBuffer, this.charReceived, 0, available);
|
101
|
+
this.charReceived += available;
|
102
|
+
|
103
|
+
if (this.charReceived < this.charLength) {
|
104
|
+
// still not enough chars in this buffer? wait for more ...
|
105
|
+
return '';
|
106
|
+
}
|
107
|
+
|
108
|
+
// remove bytes belonging to the current character from the buffer
|
109
|
+
buffer = buffer.slice(available, buffer.length);
|
110
|
+
|
111
|
+
// get the character that was split
|
112
|
+
charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
|
113
|
+
|
114
|
+
// CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
|
115
|
+
var charCode = charStr.charCodeAt(charStr.length - 1);
|
116
|
+
if (charCode >= 0xD800 && charCode <= 0xDBFF) {
|
117
|
+
this.charLength += this.surrogateSize;
|
118
|
+
charStr = '';
|
119
|
+
continue;
|
120
|
+
}
|
121
|
+
this.charReceived = this.charLength = 0;
|
122
|
+
|
123
|
+
// if there are no more bytes in this buffer, just emit our char
|
124
|
+
if (buffer.length === 0) {
|
125
|
+
return charStr;
|
126
|
+
}
|
127
|
+
break;
|
128
|
+
}
|
129
|
+
|
130
|
+
// determine and set charLength / charReceived
|
131
|
+
this.detectIncompleteChar(buffer);
|
132
|
+
|
133
|
+
var end = buffer.length;
|
134
|
+
if (this.charLength) {
|
135
|
+
// buffer the incomplete character bytes we got
|
136
|
+
buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
|
137
|
+
end -= this.charReceived;
|
138
|
+
}
|
139
|
+
|
140
|
+
charStr += buffer.toString(this.encoding, 0, end);
|
141
|
+
|
142
|
+
var end = charStr.length - 1;
|
143
|
+
var charCode = charStr.charCodeAt(end);
|
144
|
+
// CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
|
145
|
+
if (charCode >= 0xD800 && charCode <= 0xDBFF) {
|
146
|
+
var size = this.surrogateSize;
|
147
|
+
this.charLength += size;
|
148
|
+
this.charReceived += size;
|
149
|
+
this.charBuffer.copy(this.charBuffer, size, 0, size);
|
150
|
+
buffer.copy(this.charBuffer, 0, 0, size);
|
151
|
+
return charStr.substring(0, end);
|
152
|
+
}
|
153
|
+
|
154
|
+
// or just emit the charStr
|
155
|
+
return charStr;
|
156
|
+
};
|
157
|
+
|
158
|
+
// detectIncompleteChar determines if there is an incomplete UTF-8 character at
|
159
|
+
// the end of the given buffer. If so, it sets this.charLength to the byte
|
160
|
+
// length that character, and sets this.charReceived to the number of bytes
|
161
|
+
// that are available for this character.
|
162
|
+
StringDecoder.prototype.detectIncompleteChar = function(buffer) {
|
163
|
+
// determine how many bytes we have to check at the end of this buffer
|
164
|
+
var i = (buffer.length >= 3) ? 3 : buffer.length;
|
165
|
+
|
166
|
+
// Figure out if one of the last i bytes of our buffer announces an
|
167
|
+
// incomplete char.
|
168
|
+
for (; i > 0; i--) {
|
169
|
+
var c = buffer[buffer.length - i];
|
170
|
+
|
171
|
+
// See http://en.wikipedia.org/wiki/UTF-8#Description
|
172
|
+
|
173
|
+
// 110XXXXX
|
174
|
+
if (i == 1 && c >> 5 == 0x06) {
|
175
|
+
this.charLength = 2;
|
176
|
+
break;
|
177
|
+
}
|
178
|
+
|
179
|
+
// 1110XXXX
|
180
|
+
if (i <= 2 && c >> 4 == 0x0E) {
|
181
|
+
this.charLength = 3;
|
182
|
+
break;
|
183
|
+
}
|
184
|
+
|
185
|
+
// 11110XXX
|
186
|
+
if (i <= 3 && c >> 3 == 0x1E) {
|
187
|
+
this.charLength = 4;
|
188
|
+
break;
|
189
|
+
}
|
190
|
+
}
|
191
|
+
this.charReceived = i;
|
192
|
+
};
|
193
|
+
|
194
|
+
StringDecoder.prototype.end = function(buffer) {
|
195
|
+
var res = '';
|
196
|
+
if (buffer && buffer.length)
|
197
|
+
res = this.write(buffer);
|
198
|
+
|
199
|
+
if (this.charReceived) {
|
200
|
+
var cr = this.charReceived;
|
201
|
+
var buf = this.charBuffer;
|
202
|
+
var enc = this.encoding;
|
203
|
+
res += buf.slice(0, cr).toString(enc);
|
204
|
+
}
|
205
|
+
|
206
|
+
return res;
|
207
|
+
};
|
208
|
+
|
209
|
+
function passThroughWrite(buffer) {
|
210
|
+
return buffer.toString(this.encoding);
|
211
|
+
}
|
212
|
+
|
213
|
+
function utf16DetectIncompleteChar(buffer) {
|
214
|
+
this.charReceived = buffer.length % 2;
|
215
|
+
this.charLength = this.charReceived ? 2 : 0;
|
216
|
+
}
|
217
|
+
|
218
|
+
function base64DetectIncompleteChar(buffer) {
|
219
|
+
this.charReceived = buffer.length % 3;
|
220
|
+
this.charLength = this.charReceived ? 3 : 0;
|
221
|
+
}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
{
|
2
|
+
"name": "string_decoder",
|
3
|
+
"version": "0.10.31",
|
4
|
+
"description": "The string_decoder module from Node core",
|
5
|
+
"main": "index.js",
|
6
|
+
"dependencies": {},
|
7
|
+
"devDependencies": {
|
8
|
+
"tap": "~0.4.8"
|
9
|
+
},
|
10
|
+
"scripts": {
|
11
|
+
"test": "tap test/simple/*.js"
|
12
|
+
},
|
13
|
+
"repository": {
|
14
|
+
"type": "git",
|
15
|
+
"url": "git://github.com/rvagg/string_decoder.git"
|
16
|
+
},
|
17
|
+
"homepage": "https://github.com/rvagg/string_decoder",
|
18
|
+
"keywords": [
|
19
|
+
"string",
|
20
|
+
"decoder",
|
21
|
+
"browser",
|
22
|
+
"browserify"
|
23
|
+
],
|
24
|
+
"license": "MIT",
|
25
|
+
"gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0",
|
26
|
+
"bugs": {
|
27
|
+
"url": "https://github.com/rvagg/string_decoder/issues"
|
28
|
+
},
|
29
|
+
"_id": "string_decoder@0.10.31",
|
30
|
+
"_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
|
31
|
+
"_from": "string_decoder@>=0.10.0 <0.11.0",
|
32
|
+
"_npmVersion": "1.4.23",
|
33
|
+
"_npmUser": {
|
34
|
+
"name": "rvagg",
|
35
|
+
"email": "rod@vagg.org"
|
36
|
+
},
|
37
|
+
"maintainers": [
|
38
|
+
{
|
39
|
+
"name": "substack",
|
40
|
+
"email": "mail@substack.net"
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"name": "rvagg",
|
44
|
+
"email": "rod@vagg.org"
|
45
|
+
}
|
46
|
+
],
|
47
|
+
"dist": {
|
48
|
+
"shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
|
49
|
+
"tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
|
50
|
+
},
|
51
|
+
"directories": {},
|
52
|
+
"_resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
|
53
|
+
"readme": "ERROR: No README data found!"
|
54
|
+
}
|
@@ -0,0 +1,70 @@
|
|
1
|
+
{
|
2
|
+
"name": "readable-stream",
|
3
|
+
"version": "1.0.33",
|
4
|
+
"description": "Streams2, a user-land copy of the stream library from Node.js v0.10.x",
|
5
|
+
"main": "readable.js",
|
6
|
+
"dependencies": {
|
7
|
+
"core-util-is": "~1.0.0",
|
8
|
+
"isarray": "0.0.1",
|
9
|
+
"string_decoder": "~0.10.x",
|
10
|
+
"inherits": "~2.0.1"
|
11
|
+
},
|
12
|
+
"devDependencies": {
|
13
|
+
"tap": "~0.2.6"
|
14
|
+
},
|
15
|
+
"scripts": {
|
16
|
+
"test": "tap test/simple/*.js"
|
17
|
+
},
|
18
|
+
"repository": {
|
19
|
+
"type": "git",
|
20
|
+
"url": "git://github.com/isaacs/readable-stream.git"
|
21
|
+
},
|
22
|
+
"keywords": [
|
23
|
+
"readable",
|
24
|
+
"stream",
|
25
|
+
"pipe"
|
26
|
+
],
|
27
|
+
"browser": {
|
28
|
+
"util": false
|
29
|
+
},
|
30
|
+
"author": {
|
31
|
+
"name": "Isaac Z. Schlueter",
|
32
|
+
"email": "i@izs.me",
|
33
|
+
"url": "http://blog.izs.me/"
|
34
|
+
},
|
35
|
+
"license": "MIT",
|
36
|
+
"gitHead": "0bf97a117c5646556548966409ebc57a6dda2638",
|
37
|
+
"bugs": {
|
38
|
+
"url": "https://github.com/isaacs/readable-stream/issues"
|
39
|
+
},
|
40
|
+
"homepage": "https://github.com/isaacs/readable-stream",
|
41
|
+
"_id": "readable-stream@1.0.33",
|
42
|
+
"_shasum": "3a360dd66c1b1d7fd4705389860eda1d0f61126c",
|
43
|
+
"_from": "readable-stream@>=1.0.33-1 <1.1.0-0",
|
44
|
+
"_npmVersion": "1.4.28",
|
45
|
+
"_npmUser": {
|
46
|
+
"name": "rvagg",
|
47
|
+
"email": "rod@vagg.org"
|
48
|
+
},
|
49
|
+
"maintainers": [
|
50
|
+
{
|
51
|
+
"name": "isaacs",
|
52
|
+
"email": "i@izs.me"
|
53
|
+
},
|
54
|
+
{
|
55
|
+
"name": "tootallnate",
|
56
|
+
"email": "nathan@tootallnate.net"
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"name": "rvagg",
|
60
|
+
"email": "rod@vagg.org"
|
61
|
+
}
|
62
|
+
],
|
63
|
+
"dist": {
|
64
|
+
"shasum": "3a360dd66c1b1d7fd4705389860eda1d0f61126c",
|
65
|
+
"tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz"
|
66
|
+
},
|
67
|
+
"directories": {},
|
68
|
+
"_resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
|
69
|
+
"readme": "ERROR: No README data found!"
|
70
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
module.exports = require("./lib/_stream_passthrough.js")
|
@@ -0,0 +1,8 @@
|
|
1
|
+
var Stream = require('stream'); // hack to fix a circular dependency issue when used with browserify
|
2
|
+
exports = module.exports = require('./lib/_stream_readable.js');
|
3
|
+
exports.Stream = Stream;
|
4
|
+
exports.Readable = exports;
|
5
|
+
exports.Writable = require('./lib/_stream_writable.js');
|
6
|
+
exports.Duplex = require('./lib/_stream_duplex.js');
|
7
|
+
exports.Transform = require('./lib/_stream_transform.js');
|
8
|
+
exports.PassThrough = require('./lib/_stream_passthrough.js');
|
@@ -0,0 +1 @@
|
|
1
|
+
module.exports = require("./lib/_stream_transform.js")
|
@@ -0,0 +1 @@
|
|
1
|
+
module.exports = require("./lib/_stream_writable.js")
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# xtend
|
2
|
+
|
3
|
+
[![browser support][3]][4]
|
4
|
+
|
5
|
+
[![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges)
|
6
|
+
|
7
|
+
Extend like a boss
|
8
|
+
|
9
|
+
xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence.
|
10
|
+
|
11
|
+
## Examples
|
12
|
+
|
13
|
+
```js
|
14
|
+
var extend = require("xtend")
|
15
|
+
|
16
|
+
// extend returns a new object. Does not mutate arguments
|
17
|
+
var combination = extend({
|
18
|
+
a: "a",
|
19
|
+
b: 'c'
|
20
|
+
}, {
|
21
|
+
b: "b"
|
22
|
+
})
|
23
|
+
// { a: "a", b: "b" }
|
24
|
+
```
|
25
|
+
|
26
|
+
## Stability status: Locked
|
27
|
+
|
28
|
+
## MIT Licenced
|
29
|
+
|
30
|
+
|
31
|
+
[3]: http://ci.testling.com/Raynos/xtend.png
|
32
|
+
[4]: http://ci.testling.com/Raynos/xtend
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module.exports = extend
|
2
|
+
|
3
|
+
function extend() {
|
4
|
+
var target = {}
|
5
|
+
|
6
|
+
for (var i = 0; i < arguments.length; i++) {
|
7
|
+
var source = arguments[i]
|
8
|
+
|
9
|
+
for (var key in source) {
|
10
|
+
if (source.hasOwnProperty(key)) {
|
11
|
+
target[key] = source[key]
|
12
|
+
}
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
return target
|
17
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module.exports = extend
|
2
|
+
|
3
|
+
function extend(target) {
|
4
|
+
for (var i = 1; i < arguments.length; i++) {
|
5
|
+
var source = arguments[i]
|
6
|
+
|
7
|
+
for (var key in source) {
|
8
|
+
if (source.hasOwnProperty(key)) {
|
9
|
+
target[key] = source[key]
|
10
|
+
}
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
return target
|
15
|
+
}
|
@@ -0,0 +1,88 @@
|
|
1
|
+
{
|
2
|
+
"name": "xtend",
|
3
|
+
"version": "4.0.0",
|
4
|
+
"description": "extend like a boss",
|
5
|
+
"keywords": [
|
6
|
+
"extend",
|
7
|
+
"merge",
|
8
|
+
"options",
|
9
|
+
"opts",
|
10
|
+
"object",
|
11
|
+
"array"
|
12
|
+
],
|
13
|
+
"author": {
|
14
|
+
"name": "Raynos",
|
15
|
+
"email": "raynos2@gmail.com"
|
16
|
+
},
|
17
|
+
"repository": {
|
18
|
+
"type": "git",
|
19
|
+
"url": "git://github.com/Raynos/xtend.git"
|
20
|
+
},
|
21
|
+
"main": "immutable",
|
22
|
+
"scripts": {
|
23
|
+
"test": "node test"
|
24
|
+
},
|
25
|
+
"dependencies": {},
|
26
|
+
"devDependencies": {
|
27
|
+
"tape": "~1.1.0"
|
28
|
+
},
|
29
|
+
"homepage": "https://github.com/Raynos/xtend",
|
30
|
+
"contributors": [
|
31
|
+
{
|
32
|
+
"name": "Jake Verbaten"
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"name": "Matt Esch"
|
36
|
+
}
|
37
|
+
],
|
38
|
+
"bugs": {
|
39
|
+
"url": "https://github.com/Raynos/xtend/issues",
|
40
|
+
"email": "raynos2@gmail.com"
|
41
|
+
},
|
42
|
+
"licenses": [
|
43
|
+
{
|
44
|
+
"type": "MIT",
|
45
|
+
"url": "http://github.com/raynos/xtend/raw/master/LICENSE"
|
46
|
+
}
|
47
|
+
],
|
48
|
+
"testling": {
|
49
|
+
"files": "test.js",
|
50
|
+
"browsers": [
|
51
|
+
"ie/7..latest",
|
52
|
+
"firefox/16..latest",
|
53
|
+
"firefox/nightly",
|
54
|
+
"chrome/22..latest",
|
55
|
+
"chrome/canary",
|
56
|
+
"opera/12..latest",
|
57
|
+
"opera/next",
|
58
|
+
"safari/5.1..latest",
|
59
|
+
"ipad/6.0..latest",
|
60
|
+
"iphone/6.0..latest"
|
61
|
+
]
|
62
|
+
},
|
63
|
+
"engines": {
|
64
|
+
"node": ">=0.4"
|
65
|
+
},
|
66
|
+
"gitHead": "94a95d76154103290533b2c55ffa0fe4be16bfef",
|
67
|
+
"_id": "xtend@4.0.0",
|
68
|
+
"_shasum": "8bc36ff87aedbe7ce9eaf0bca36b2354a743840f",
|
69
|
+
"_from": "xtend@>=4.0.0 <4.1.0-0",
|
70
|
+
"_npmVersion": "1.4.15",
|
71
|
+
"_npmUser": {
|
72
|
+
"name": "raynos",
|
73
|
+
"email": "raynos2@gmail.com"
|
74
|
+
},
|
75
|
+
"maintainers": [
|
76
|
+
{
|
77
|
+
"name": "raynos",
|
78
|
+
"email": "raynos2@gmail.com"
|
79
|
+
}
|
80
|
+
],
|
81
|
+
"dist": {
|
82
|
+
"shasum": "8bc36ff87aedbe7ce9eaf0bca36b2354a743840f",
|
83
|
+
"tarball": "http://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz"
|
84
|
+
},
|
85
|
+
"directories": {},
|
86
|
+
"_resolved": "http://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz",
|
87
|
+
"readme": "ERROR: No README data found!"
|
88
|
+
}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
var test = require("tape")
|
2
|
+
var extend = require("./")
|
3
|
+
var mutableExtend = require("./mutable")
|
4
|
+
|
5
|
+
test("merge", function(assert) {
|
6
|
+
var a = { a: "foo" }
|
7
|
+
var b = { b: "bar" }
|
8
|
+
|
9
|
+
assert.deepEqual(extend(a, b), { a: "foo", b: "bar" })
|
10
|
+
assert.end()
|
11
|
+
})
|
12
|
+
|
13
|
+
test("replace", function(assert) {
|
14
|
+
var a = { a: "foo" }
|
15
|
+
var b = { a: "bar" }
|
16
|
+
|
17
|
+
assert.deepEqual(extend(a, b), { a: "bar" })
|
18
|
+
assert.end()
|
19
|
+
})
|
20
|
+
|
21
|
+
test("undefined", function(assert) {
|
22
|
+
var a = { a: undefined }
|
23
|
+
var b = { b: "foo" }
|
24
|
+
|
25
|
+
assert.deepEqual(extend(a, b), { a: undefined, b: "foo" })
|
26
|
+
assert.deepEqual(extend(b, a), { a: undefined, b: "foo" })
|
27
|
+
assert.end()
|
28
|
+
})
|
29
|
+
|
30
|
+
test("handle 0", function(assert) {
|
31
|
+
var a = { a: "default" }
|
32
|
+
var b = { a: 0 }
|
33
|
+
|
34
|
+
assert.deepEqual(extend(a, b), { a: 0 })
|
35
|
+
assert.deepEqual(extend(b, a), { a: "default" })
|
36
|
+
assert.end()
|
37
|
+
})
|
38
|
+
|
39
|
+
test("is immutable", function (assert) {
|
40
|
+
var record = {}
|
41
|
+
|
42
|
+
extend(record, { foo: "bar" })
|
43
|
+
assert.equal(record.foo, undefined)
|
44
|
+
assert.end()
|
45
|
+
})
|
46
|
+
|
47
|
+
test("null as argument", function (assert) {
|
48
|
+
var a = { foo: "bar" }
|
49
|
+
var b = null
|
50
|
+
var c = void 0
|
51
|
+
|
52
|
+
assert.deepEqual(extend(b, a, c), { foo: "bar" })
|
53
|
+
assert.end()
|
54
|
+
})
|
55
|
+
|
56
|
+
test("mutable", function (assert) {
|
57
|
+
var a = { foo: "bar" }
|
58
|
+
|
59
|
+
mutableExtend(a, { bar: "baz" })
|
60
|
+
|
61
|
+
assert.equal(a.bar, "baz")
|
62
|
+
assert.end()
|
63
|
+
})
|
@@ -0,0 +1,65 @@
|
|
1
|
+
{
|
2
|
+
"name": "through2",
|
3
|
+
"version": "0.6.5",
|
4
|
+
"description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise",
|
5
|
+
"main": "through2.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "node test/test.js",
|
8
|
+
"test-local": "brtapsauce-local test/basic-test.js"
|
9
|
+
},
|
10
|
+
"repository": {
|
11
|
+
"type": "git",
|
12
|
+
"url": "git+https://github.com/rvagg/through2.git"
|
13
|
+
},
|
14
|
+
"keywords": [
|
15
|
+
"stream",
|
16
|
+
"streams2",
|
17
|
+
"through",
|
18
|
+
"transform"
|
19
|
+
],
|
20
|
+
"author": {
|
21
|
+
"name": "Rod Vagg",
|
22
|
+
"email": "r@va.gg",
|
23
|
+
"url": "https://github.com/rvagg"
|
24
|
+
},
|
25
|
+
"license": "MIT",
|
26
|
+
"dependencies": {
|
27
|
+
"readable-stream": ">=1.0.33-1 <1.1.0-0",
|
28
|
+
"xtend": ">=4.0.0 <4.1.0-0"
|
29
|
+
},
|
30
|
+
"devDependencies": {
|
31
|
+
"bl": ">=0.9.0 <0.10.0-0",
|
32
|
+
"stream-spigot": ">=3.0.4 <3.1.0-0",
|
33
|
+
"tape": ">=2.14.0 <2.15.0-0"
|
34
|
+
},
|
35
|
+
"gitHead": "ba4a87875f2c82323c10023e36f4ae4b386c1bf8",
|
36
|
+
"bugs": {
|
37
|
+
"url": "https://github.com/rvagg/through2/issues"
|
38
|
+
},
|
39
|
+
"homepage": "https://github.com/rvagg/through2",
|
40
|
+
"_id": "through2@0.6.5",
|
41
|
+
"_shasum": "41ab9c67b29d57209071410e1d7a7a968cd3ad48",
|
42
|
+
"_from": "through2@>=0.6.1 <0.7.0",
|
43
|
+
"_npmVersion": "1.4.28",
|
44
|
+
"_npmUser": {
|
45
|
+
"name": "bryce",
|
46
|
+
"email": "bryce@ravenwall.com"
|
47
|
+
},
|
48
|
+
"maintainers": [
|
49
|
+
{
|
50
|
+
"name": "rvagg",
|
51
|
+
"email": "rod@vagg.org"
|
52
|
+
},
|
53
|
+
{
|
54
|
+
"name": "bryce",
|
55
|
+
"email": "bryce@ravenwall.com"
|
56
|
+
}
|
57
|
+
],
|
58
|
+
"dist": {
|
59
|
+
"shasum": "41ab9c67b29d57209071410e1d7a7a968cd3ad48",
|
60
|
+
"tarball": "http://registry.npmjs.org/through2/-/through2-0.6.5.tgz"
|
61
|
+
},
|
62
|
+
"directories": {},
|
63
|
+
"_resolved": "http://registry.npmjs.org/through2/-/through2-0.6.5.tgz",
|
64
|
+
"readme": "ERROR: No README data found!"
|
65
|
+
}
|