File tree Expand file tree Collapse file tree 4 files changed +38
-10
lines changed Expand file tree Collapse file tree 4 files changed +38
-10
lines changed Original file line number Diff line number Diff line change
1
+ sudo : false
2
+
1
3
language : node_js
2
4
5
+ notifications :
6
+ email : false
7
+
3
8
before_install :
4
9
- ' [ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g npm@1.4.28'
5
10
- npm install -g npm@latest
@@ -13,6 +18,7 @@ node_js:
13
18
- ' 0.8'
14
19
- ' 0.10'
15
20
- ' 0.12'
21
+ - ' 4'
16
22
- ' iojs-v1.0.0'
17
23
- ' iojs-v2.0.0'
18
24
- ' iojs-v3.0.0'
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ other streams.
7
7
[ ![ build status] [ 3 ]] [ 4 ]
8
8
[ ![ dependencies] [ 5 ]] [ 6 ]
9
9
[ ![ devDependencies] [ 7 ]] [ 8 ]
10
+ [ ![ Inch CI] [ 16 ]] [ 17 ]
10
11
11
12
[ // ] : [![testling][9]][10]
12
13
@@ -71,6 +72,8 @@ npm install stream-array
71
72
[ 13 ] : http://nodejs.org/api/globals.html#globals_require
72
73
[ 14 ] : https://nodejs.org/api/stream.html#stream_readable_push_chunk_encoding
73
74
[ 15 ] : https://nodejs.org/api/stream.html#stream_readable_pipe_destination_options
75
+ [ 16 ] : https://inch-ci.org/github/mimetnet/node-stream-array.svg?branch=master
76
+ [ 17 ] : http://inch-ci.org/github/mimetnet/node-stream-array
74
77
75
78
## License
76
79
Original file line number Diff line number Diff line change
1
+ 'use strict'
2
+
1
3
var Readable = require ( 'readable-stream' ) . Readable
2
4
;
3
5
6
+ /**
7
+ * Create a new instance of StreamArray
8
+ *
9
+ * @access private
10
+ * @param {Array } list
11
+ */
4
12
function StreamArray ( list ) {
5
13
if ( ! Array . isArray ( list ) )
6
14
throw new TypeError ( 'First argument must be an Array' ) ;
@@ -14,10 +22,25 @@ function StreamArray(list) {
14
22
15
23
StreamArray . prototype = Object . create ( Readable . prototype , { constructor : { value : StreamArray } } ) ;
16
24
25
+ /**
26
+ * Read the next item from the source Array and push into NodeJS stream
27
+
28
+ * @access protected
29
+ * @desc Read the next item from the source Array and push into NodeJS stream
30
+ * @param {number } size The amount of data to read (ignored)
31
+ */
17
32
StreamArray . prototype . _read = function ( size ) {
18
33
this . push ( this . _i < this . _l ? this . _list [ this . _i ++ ] : null ) ;
19
34
} ;
20
35
36
+ /**
37
+ * Create a new instance of StreamArray
38
+ *
39
+ * @module stream-array
40
+ * @desc Push Array elements through a NodeJS stream
41
+ * @type {function }
42
+ * @param {Array } list An Array of objects, strings, numbers, etc
43
+ */
21
44
module . exports = function ( list ) {
22
45
return new StreamArray ( list ) ;
23
46
} ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " stream-array" ,
3
- "version" : " 1.1.1 " ,
3
+ "version" : " 1.1.2-beta " ,
4
4
"description" : " Pipe an Array through Node.js streams" ,
5
5
"dependencies" : {
6
6
"readable-stream" : " ~2.0.0"
20
20
"bugs" : {
21
21
"url" : " https://github.com/mimetnet/node-stream-array/issues"
22
22
},
23
+ "homepage" : " https://github.com/mimetnet/node-stream-array" ,
23
24
"keywords" : [
24
25
" array" ,
25
26
" readable" ,
26
27
" stream" ,
27
28
" pipe"
28
29
],
29
30
"author" : " Matthew I. Metnetsky <matthew@cowarthill.com>" ,
30
- "license" : [
31
- {
32
- "type" : " MIT" ,
33
- "url" : " http://opensource.org/licenses/MIT"
34
- }
35
- ],
31
+ "license" : " MIT" ,
36
32
"main" : " index.js" ,
37
33
"directories" : {
38
34
"test" : " test"
55
51
" android-browser/4.2..latest"
56
52
]
57
53
},
58
- "engines" : [
59
- " node >= 0.8.0 "
60
- ]
54
+ "engines" : {
55
+ "node" : " >= 0.8"
56
+ }
61
57
}
You can’t perform that action at this time.
0 commit comments