mirror of
https://github.com/bvanroll/rpiRadio.git
synced 2025-08-30 12:32:47 +00:00
Initial Commit
This commit is contained in:
3
ProjectNow/NodeServer/node_modules/stream-combiner/.npmignore
generated
vendored
Normal file
3
ProjectNow/NodeServer/node_modules/stream-combiner/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
node_modules
|
||||
node_modules/*
|
||||
npm_debug.log
|
4
ProjectNow/NodeServer/node_modules/stream-combiner/.travis.yml
generated
vendored
Normal file
4
ProjectNow/NodeServer/node_modules/stream-combiner/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 0.6
|
||||
- 0.8
|
22
ProjectNow/NodeServer/node_modules/stream-combiner/LICENSE
generated
vendored
Normal file
22
ProjectNow/NodeServer/node_modules/stream-combiner/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
Copyright (c) 2012 'Dominic Tarr'
|
||||
|
||||
Permission is hereby granted, free of charge,
|
||||
to any person obtaining a copy of this software and
|
||||
associated documentation files (the "Software"), to
|
||||
deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify,
|
||||
merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom
|
||||
the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
|
||||
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
29
ProjectNow/NodeServer/node_modules/stream-combiner/README.md
generated
vendored
Normal file
29
ProjectNow/NodeServer/node_modules/stream-combiner/README.md
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# stream-combiner
|
||||
|
||||
<img src=https://secure.travis-ci.org/dominictarr/stream-combiner.png?branch=master>
|
||||
|
||||
## Combine (stream1,...,streamN)
|
||||
|
||||
Turn a pipeline into a single stream. `pipeline` returns a stream that writes to the first stream
|
||||
and reads from the last stream.
|
||||
|
||||
Listening for 'error' will recieve errors from all streams inside the pipe.
|
||||
|
||||
``` js
|
||||
var Combine = require('stream-combiner')
|
||||
var es = require('event-stream')
|
||||
|
||||
Combine( //connect streams together with `pipe`
|
||||
process.openStdin(), //open stdin
|
||||
es.split(), //split stream to break on newlines
|
||||
es.map(function (data, callback) {//turn this async function into a stream
|
||||
callback(null
|
||||
, inspect(JSON.parse(data))) //render it nicely
|
||||
}),
|
||||
process.stdout // pipe it to stdout !
|
||||
)
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
39
ProjectNow/NodeServer/node_modules/stream-combiner/index.js
generated
vendored
Normal file
39
ProjectNow/NodeServer/node_modules/stream-combiner/index.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
var duplexer = require('duplexer')
|
||||
|
||||
module.exports = function () {
|
||||
|
||||
var streams = [].slice.call(arguments)
|
||||
, first = streams[0]
|
||||
, last = streams[streams.length - 1]
|
||||
, thepipe = duplexer(first, last)
|
||||
|
||||
if(streams.length == 1)
|
||||
return streams[0]
|
||||
else if (!streams.length)
|
||||
throw new Error('connect called with empty args')
|
||||
|
||||
//pipe all the streams together
|
||||
|
||||
function recurse (streams) {
|
||||
if(streams.length < 2)
|
||||
return
|
||||
streams[0].pipe(streams[1])
|
||||
recurse(streams.slice(1))
|
||||
}
|
||||
|
||||
recurse(streams)
|
||||
|
||||
function onerror () {
|
||||
var args = [].slice.call(arguments)
|
||||
args.unshift('error')
|
||||
thepipe.emit.apply(thepipe, args)
|
||||
}
|
||||
|
||||
//es.duplex already reemits the error from the first and last stream.
|
||||
//add a listener for the inner streams in the pipeline.
|
||||
for(var i = 1; i < streams.length - 1; i ++)
|
||||
streams[i].on('error', onerror)
|
||||
|
||||
return thepipe
|
||||
}
|
||||
|
54
ProjectNow/NodeServer/node_modules/stream-combiner/package.json
generated
vendored
Normal file
54
ProjectNow/NodeServer/node_modules/stream-combiner/package.json
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"_from": "stream-combiner@~0.0.4",
|
||||
"_id": "stream-combiner@0.0.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=",
|
||||
"_location": "/stream-combiner",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "stream-combiner@~0.0.4",
|
||||
"name": "stream-combiner",
|
||||
"escapedName": "stream-combiner",
|
||||
"rawSpec": "~0.0.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~0.0.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/event-stream"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz",
|
||||
"_shasum": "4d5e433c185261dde623ca3f44c586bcf5c4ad14",
|
||||
"_spec": "stream-combiner@~0.0.4",
|
||||
"_where": "/home/beppe/Documents/Python/proj/1718PROJrpiRadio/NodeServer/node_modules/event-stream",
|
||||
"author": {
|
||||
"name": "'Dominic Tarr'",
|
||||
"email": "dominic.tarr@gmail.com",
|
||||
"url": "http://dominictarr.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/dominictarr/stream-combiner/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"duplexer": "~0.1.1"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "<img src=https://secure.travis-ci.org/dominictarr/stream-combiner.png?branch=master>",
|
||||
"devDependencies": {
|
||||
"event-stream": "~3.0.7",
|
||||
"tape": "~2.3.0"
|
||||
},
|
||||
"homepage": "https://github.com/dominictarr/stream-combiner",
|
||||
"license": "MIT",
|
||||
"name": "stream-combiner",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/dominictarr/stream-combiner.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "set -e; for t in test/*.js; do node $t; done"
|
||||
},
|
||||
"version": "0.0.4"
|
||||
}
|
52
ProjectNow/NodeServer/node_modules/stream-combiner/test/index.js
generated
vendored
Normal file
52
ProjectNow/NodeServer/node_modules/stream-combiner/test/index.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
var es = require('event-stream')
|
||||
var combine = require('..')
|
||||
var test = require('tape')
|
||||
|
||||
test('do not duplicate errors', function (test) {
|
||||
|
||||
var errors = 0;
|
||||
var pipe = combine(
|
||||
es.through(function(data) {
|
||||
return this.emit('data', data);
|
||||
}),
|
||||
es.through(function(data) {
|
||||
return this.emit('error', new Error(data));
|
||||
})
|
||||
)
|
||||
|
||||
pipe.on('error', function(err) {
|
||||
errors++
|
||||
test.ok(errors, 'expected error count')
|
||||
process.nextTick(function () {
|
||||
return test.end();
|
||||
})
|
||||
})
|
||||
|
||||
return pipe.write('meh');
|
||||
})
|
||||
|
||||
test('3 pipe do not duplicate errors', function (test) {
|
||||
|
||||
var errors = 0;
|
||||
var pipe = combine(
|
||||
es.through(function(data) {
|
||||
return this.emit('data', data);
|
||||
}),
|
||||
es.through(function(data) {
|
||||
return this.emit('error', new Error(data));
|
||||
}),
|
||||
es.through()
|
||||
)
|
||||
|
||||
pipe.on('error', function(err) {
|
||||
errors++
|
||||
test.ok(errors, 'expected error count')
|
||||
process.nextTick(function () {
|
||||
return test.end();
|
||||
})
|
||||
})
|
||||
|
||||
return pipe.write('meh');
|
||||
|
||||
})
|
||||
|
Reference in New Issue
Block a user