Skip to content

Commit 069d6c8

Browse files
committed
merge :: 'devel' of github.com:mimetnet/node-stream-array
* 'devel' of github.com:mimetnet/node-stream-array: index.js :: 'use strict' index.js :: add jsdoc comments to make Inch CI happy README.md :: include Inch CI badge for documentation package.json :: update structure travis.yml :: test against node v4 travis.yml :: use build containers & disable email package.json :: 1.1.2-beta
2 parents 47b3dc8 + 9aaf9f5 commit 069d6c8

File tree

4 files changed

+38
-10
lines changed

4 files changed

+38
-10
lines changed

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
sudo: false
2+
13
language: node_js
24

5+
notifications:
6+
email: false
7+
38
before_install:
49
- '[ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g npm@1.4.28'
510
- npm install -g npm@latest
@@ -13,6 +18,7 @@ node_js:
1318
- '0.8'
1419
- '0.10'
1520
- '0.12'
21+
- '4'
1622
- 'iojs-v1.0.0'
1723
- 'iojs-v2.0.0'
1824
- 'iojs-v3.0.0'

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ other streams.
77
[![build status][3]][4]
88
[![dependencies][5]][6]
99
[![devDependencies][7]][8]
10+
[![Inch CI][16]][17]
1011

1112
[//]: [![testling][9]][10]
1213

@@ -71,6 +72,8 @@ npm install stream-array
7172
[13]: http://nodejs.org/api/globals.html#globals_require
7273
[14]: https://nodejs.org/api/stream.html#stream_readable_push_chunk_encoding
7374
[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
7477

7578
## License
7679

index.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
'use strict'
2+
13
var Readable = require('readable-stream').Readable
24
;
35

6+
/**
7+
* Create a new instance of StreamArray
8+
*
9+
* @access private
10+
* @param {Array} list
11+
*/
412
function StreamArray(list) {
513
if (!Array.isArray(list))
614
throw new TypeError('First argument must be an Array');
@@ -14,10 +22,25 @@ function StreamArray(list) {
1422

1523
StreamArray.prototype = Object.create(Readable.prototype, {constructor: {value: StreamArray}});
1624

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+
*/
1732
StreamArray.prototype._read = function(size) {
1833
this.push(this._i < this._l ? this._list[this._i++] : null);
1934
};
2035

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+
*/
2144
module.exports = function(list) {
2245
return new StreamArray(list);
2346
};

package.json

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "stream-array",
3-
"version": "1.1.1",
3+
"version": "1.1.2-beta",
44
"description": "Pipe an Array through Node.js streams",
55
"dependencies": {
66
"readable-stream": "~2.0.0"
@@ -20,19 +20,15 @@
2020
"bugs": {
2121
"url": "https://github.com/mimetnet/node-stream-array/issues"
2222
},
23+
"homepage": "https://github.com/mimetnet/node-stream-array",
2324
"keywords": [
2425
"array",
2526
"readable",
2627
"stream",
2728
"pipe"
2829
],
2930
"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",
3632
"main": "index.js",
3733
"directories": {
3834
"test": "test"
@@ -55,7 +51,7 @@
5551
"android-browser/4.2..latest"
5652
]
5753
},
58-
"engines": [
59-
"node >= 0.8.0"
60-
]
54+
"engines": {
55+
"node" : ">= 0.8"
56+
}
6157
}

0 commit comments

Comments
 (0)