mqtt stuff added
This commit is contained in:
60
node_modules/callback-stream/.jshintrc
generated
vendored
Normal file
60
node_modules/callback-stream/.jshintrc
generated
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
{
|
||||
"predef": [ ]
|
||||
, "bitwise": false
|
||||
, "camelcase": false
|
||||
, "curly": false
|
||||
, "eqeqeq": false
|
||||
, "forin": false
|
||||
, "immed": false
|
||||
, "latedef": false
|
||||
, "noarg": true
|
||||
, "noempty": true
|
||||
, "nonew": true
|
||||
, "plusplus": false
|
||||
, "quotmark": true
|
||||
, "regexp": false
|
||||
, "undef": true
|
||||
, "unused": true
|
||||
, "strict": false
|
||||
, "trailing": true
|
||||
, "maxlen": 120
|
||||
, "asi": true
|
||||
, "boss": true
|
||||
, "debug": true
|
||||
, "eqnull": true
|
||||
, "es5": true
|
||||
, "esnext": true
|
||||
, "evil": true
|
||||
, "expr": true
|
||||
, "funcscope": false
|
||||
, "globalstrict": false
|
||||
, "iterator": false
|
||||
, "lastsemic": true
|
||||
, "laxbreak": true
|
||||
, "laxcomma": true
|
||||
, "loopfunc": true
|
||||
, "multistr": false
|
||||
, "onecase": false
|
||||
, "proto": false
|
||||
, "regexdash": false
|
||||
, "scripturl": true
|
||||
, "smarttabs": false
|
||||
, "shadow": false
|
||||
, "sub": true
|
||||
, "supernew": false
|
||||
, "validthis": true
|
||||
, "browser": true
|
||||
, "couch": false
|
||||
, "devel": false
|
||||
, "dojo": false
|
||||
, "mootools": false
|
||||
, "node": true
|
||||
, "nonstandard": true
|
||||
, "prototypejs": false
|
||||
, "rhino": false
|
||||
, "worker": true
|
||||
, "wsh": false
|
||||
, "nomen": false
|
||||
, "onevar": true
|
||||
, "passfail": false
|
||||
}
|
7
node_modules/callback-stream/.npmignore
generated
vendored
Normal file
7
node_modules/callback-stream/.npmignore
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
node_modules/
|
||||
build/
|
||||
libleveldb.so
|
||||
libleveldb.a
|
||||
test-data/
|
||||
_benchdb_*
|
||||
*.sw*
|
4
node_modules/callback-stream/.travis.yml
generated
vendored
Normal file
4
node_modules/callback-stream/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 0.8
|
||||
- "0.10"
|
86
node_modules/callback-stream/README.md
generated
vendored
Normal file
86
node_modules/callback-stream/README.md
generated
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
CallbackStream
|
||||
=====
|
||||
|
||||
[](https://travis-ci.org/mcollina/callback-stream)
|
||||
|
||||
It is a safe variant of the
|
||||
[concat-stream](https://github.com/maxogden/node-concat-stream)
|
||||
package that _will always return an array_.
|
||||
|
||||
It does everything callback-stream does, minus the concatenation.
|
||||
In fact, it just callbacks you with an array containing your
|
||||
good stuff.
|
||||
|
||||
It is based on the Stream 2 API, but it also works on node v0.8.
|
||||
It also support Stream 3, which is bundled with node v0.12 and iojs.
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
npm install callback-stream --save
|
||||
```
|
||||
|
||||
## Pipe usage
|
||||
|
||||
```js
|
||||
var callback = require('callback-stream')
|
||||
var fs = require('fs')
|
||||
var read = fs.createReadStream('readme.md')
|
||||
var write = callback(function (err, data) {
|
||||
console.log(err, data)
|
||||
})
|
||||
|
||||
read.pipe(write)
|
||||
```
|
||||
|
||||
## Object mode usage
|
||||
|
||||
```
|
||||
var callback = require('callback-stream')
|
||||
var write = callback.obj(function (err, data) {
|
||||
// this will print ['hello', 'world']
|
||||
console.log(data)
|
||||
})
|
||||
|
||||
write.write('hello')
|
||||
write.write('world')
|
||||
write.end()
|
||||
```
|
||||
|
||||
## Contributing to CallbackStream
|
||||
|
||||
* Check out the latest master to make sure the feature hasn't been
|
||||
implemented or the bug hasn't been fixed yet
|
||||
* Check out the issue tracker to make sure someone already hasn't
|
||||
requested it and/or contributed it
|
||||
* Fork the project
|
||||
* Start a feature/bugfix branch
|
||||
* Commit and push until you are happy with your contribution
|
||||
* Make sure to add tests for it. This is important so I don't break it
|
||||
in a future version unintentionally.
|
||||
|
||||
## LICENSE - "MIT License"
|
||||
|
||||
Copyright (c) 2013-2015 Matteo Collina, http://matteocollina.com
|
||||
|
||||
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.
|
51
node_modules/callback-stream/index.js
generated
vendored
Normal file
51
node_modules/callback-stream/index.js
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
'use strict'
|
||||
|
||||
var Writable = require('readable-stream').Writable
|
||||
var inherits = require('inherits')
|
||||
|
||||
function CallbackStream (options, callback) {
|
||||
if (!(this instanceof CallbackStream)) {
|
||||
return new CallbackStream(options, callback)
|
||||
}
|
||||
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
|
||||
Writable.call(this, options)
|
||||
|
||||
this.results = []
|
||||
this.callback = callback
|
||||
|
||||
this.on('finish', deliversCallback)
|
||||
this.once('pipe', handlePipe)
|
||||
}
|
||||
|
||||
function deliversCallback () {
|
||||
this.callback(null, this.results)
|
||||
}
|
||||
|
||||
function handlePipe (source) {
|
||||
source.on('error', this.callback)
|
||||
}
|
||||
|
||||
inherits(CallbackStream, Writable)
|
||||
|
||||
CallbackStream.prototype._write = function (data, encoding, done) {
|
||||
this.results.push(data)
|
||||
done()
|
||||
}
|
||||
|
||||
CallbackStream.obj = function (options, callback) {
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
|
||||
options.objectMode = true
|
||||
|
||||
return new CallbackStream(options, callback)
|
||||
}
|
||||
|
||||
module.exports = CallbackStream
|
67
node_modules/callback-stream/package.json
generated
vendored
Normal file
67
node_modules/callback-stream/package.json
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
{
|
||||
"_from": "callback-stream@^1.0.2",
|
||||
"_id": "callback-stream@1.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-RwGlEmbwbgbqpx/BcjOCLYdfSQg=",
|
||||
"_location": "/callback-stream",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "callback-stream@^1.0.2",
|
||||
"name": "callback-stream",
|
||||
"escapedName": "callback-stream",
|
||||
"rawSpec": "^1.0.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/help-me"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/callback-stream/-/callback-stream-1.1.0.tgz",
|
||||
"_shasum": "4701a51266f06e06eaa71fc17233822d875f4908",
|
||||
"_spec": "callback-stream@^1.0.2",
|
||||
"_where": "/home/wn/workspace-node/PiAlive/node_modules/help-me",
|
||||
"author": {
|
||||
"name": "Matteo Collina",
|
||||
"email": "hello@matteocollina.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "http://github.com/mcollina/callback-stream/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.1",
|
||||
"readable-stream": "> 1.0.0 < 3.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "A pipeable stream that calls your callback",
|
||||
"devDependencies": {
|
||||
"pre-commit": "^1.1.1",
|
||||
"standard": "^5.0.0",
|
||||
"tap": "~0.4.2",
|
||||
"tape": "^4.0.2"
|
||||
},
|
||||
"homepage": "https://github.com/mcollina/callback-stream#readme",
|
||||
"keywords": [
|
||||
"callback",
|
||||
"stream"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "callback-stream",
|
||||
"precommit": [
|
||||
"lint",
|
||||
"test"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/mcollina/callback-stream.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "standard",
|
||||
"test": "tap test.js"
|
||||
},
|
||||
"version": "1.1.0",
|
||||
"website": "https://github.com/mcollina/callback-stream"
|
||||
}
|
57
node_modules/callback-stream/test.js
generated
vendored
Normal file
57
node_modules/callback-stream/test.js
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
'use strict'
|
||||
|
||||
var test = require('tap').test
|
||||
var callback = require('./')
|
||||
var fs = require('fs')
|
||||
|
||||
test('call the callback after end with object mode', function (t) {
|
||||
var opts = { objectMode: true }
|
||||
var stream = callback(opts, function (err, results) {
|
||||
t.deepEqual(results, ['hello'], 'should return the ending value')
|
||||
t.end()
|
||||
})
|
||||
|
||||
stream.end('hello')
|
||||
})
|
||||
|
||||
test('support multiple writes with object mode', function (t) {
|
||||
var opts = { objectMode: true }
|
||||
var stream = callback(opts, function (err, results) {
|
||||
t.deepEqual(results, ['hello', 'world'], 'should return the ending value')
|
||||
t.end()
|
||||
})
|
||||
|
||||
stream.write('hello')
|
||||
stream.end('world')
|
||||
})
|
||||
|
||||
test('works without object mode', function (t) {
|
||||
var stream = callback(function (err, results) {
|
||||
t.equal(results.length, 1, 'should contain only one value')
|
||||
t.deepEqual(results[0].toString(), 'world', 'should return the ending value')
|
||||
t.end()
|
||||
})
|
||||
|
||||
stream.end('world')
|
||||
})
|
||||
|
||||
test('is pipeable', function (t) {
|
||||
var write = callback(function (err, results) {
|
||||
var actual = Buffer.concat(results).toString()
|
||||
var expected = fs.readFileSync('README.md').toString()
|
||||
t.equal(actual, expected, 'should have the same content of the file')
|
||||
t.end()
|
||||
})
|
||||
var read = fs.createReadStream('README.md')
|
||||
|
||||
read.pipe(write)
|
||||
})
|
||||
|
||||
test('callback.obj shortcut for objectMode', function (t) {
|
||||
var stream = callback.obj(function (err, results) {
|
||||
t.deepEqual(results, ['hello'], 'should return the ending value')
|
||||
t.end()
|
||||
})
|
||||
|
||||
stream.end('hello')
|
||||
})
|
Reference in New Issue
Block a user