mqtt stuff added
This commit is contained in:
21
node_modules/glob-stream/LICENSE
generated
vendored
Executable file
21
node_modules/glob-stream/LICENSE
generated
vendored
Executable file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-2017 Blaine Bublitz <blaine.bublitz@gmail.com>, Eric Schoffstall <yo@contra.io> and other contributors
|
||||
|
||||
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.
|
146
node_modules/glob-stream/README.md
generated
vendored
Normal file
146
node_modules/glob-stream/README.md
generated
vendored
Normal file
@ -0,0 +1,146 @@
|
||||
<p align="center">
|
||||
<a href="http://gulpjs.com">
|
||||
<img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
# glob-stream
|
||||
|
||||
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]
|
||||
|
||||
A [Readable Stream][readable-stream-url] interface over [node-glob][node-glob-url].
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var gs = require('glob-stream');
|
||||
|
||||
var readable = gs('./files/**/*.coffee', { /* options */ });
|
||||
|
||||
var writable = /* your WriteableStream */
|
||||
|
||||
readable.pipe(writable);
|
||||
```
|
||||
|
||||
You can pass any combination of glob strings. One caveat is that you cannot __only__ pass a negative glob, you must give it at least one positive glob so it knows where to start. If given a non-glob path (also referred to as a singular glob), only one file will be emitted. If given a singular glob and no files match, an error is emitted (see also [`options.allowEmpty`][allow-empty-url]).
|
||||
|
||||
## API
|
||||
|
||||
### `globStream(globs, options)`
|
||||
|
||||
Takes a glob string or an array of glob strings as the first argument and an options object as the second. Returns a stream of objects that contain `cwd`, `base` and `path` properties.
|
||||
|
||||
#### Options
|
||||
|
||||
##### `options.allowEmpty`
|
||||
|
||||
Whether or not to error upon an empty singular glob.
|
||||
|
||||
Type: `Boolean`
|
||||
|
||||
Default: `false` (error upon no match)
|
||||
|
||||
##### `options.dot`
|
||||
|
||||
Whether or not to treat dotfiles as regular files. This is passed through to [node-glob][node-glob-url].
|
||||
|
||||
Type: `Boolean`
|
||||
|
||||
Default: `false`
|
||||
|
||||
##### `options.silent`
|
||||
|
||||
Whether or not to suppress warnings on stderr from [node-glob][node-glob-url]. This is passed through to [node-glob][node-glob-url].
|
||||
|
||||
Type: `Boolean`
|
||||
|
||||
Default: `true`
|
||||
|
||||
##### `options.cwd`
|
||||
|
||||
The current working directory that the glob is resolved against.
|
||||
|
||||
Type: `String`
|
||||
|
||||
Default: `process.cwd()`
|
||||
|
||||
##### `options.root`
|
||||
|
||||
The root path that the glob is resolved against.
|
||||
|
||||
__Note: This is never passed to [node-glob][node-glob-url] because it is pre-resolved against your paths.__
|
||||
|
||||
Type: `String`
|
||||
|
||||
Default: `undefined` (use the filesystem root)
|
||||
|
||||
##### `options.base`
|
||||
|
||||
The absolute segment of the glob path that isn't a glob. This value is attached to each glob object and is useful for relative pathing.
|
||||
|
||||
Type: `String`
|
||||
|
||||
Default: The absolute path segement before a glob starts (see [glob-parent][glob-parent-url])
|
||||
|
||||
##### `options.cwdbase`
|
||||
|
||||
Whether or not the `cwd` and `base` should be the same.
|
||||
|
||||
Type: `Boolean`
|
||||
|
||||
Default: `false`
|
||||
|
||||
##### `options.uniqueBy`
|
||||
|
||||
Filters stream to remove duplicates based on the string property name or the result of function. When using a function, the function receives the streamed data (objects containing `cwd`, `base`, `path` properties) to compare against.
|
||||
|
||||
Type: `String` or `Function`
|
||||
|
||||
Default: `'path'`
|
||||
|
||||
##### other
|
||||
|
||||
Any glob-related options are documented in [node-glob][node-glob-url]. Those options are forwarded verbatim, with the exception of `root` and `ignore`. `root` is pre-resolved and `ignore` is joined with all negative globs.
|
||||
|
||||
#### Globbing & Negation
|
||||
|
||||
```js
|
||||
var stream = gs(['./**/*.js', '!./node_modules/**/*']);
|
||||
```
|
||||
|
||||
Globs are executed in order, so negations should follow positive globs. For example:
|
||||
|
||||
The following would __not__ exclude any files:
|
||||
```js
|
||||
gs(['!b*.js', '*.js'])
|
||||
```
|
||||
|
||||
However, this would exclude all files that started with `b`:
|
||||
```js
|
||||
gs(['*.js', '!b*.js'])
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
[node-glob-url]: https://github.com/isaacs/node-glob
|
||||
[glob-parent-url]: https://github.com/es128/glob-parent
|
||||
[allow-empty-url]: #optionsallowempty
|
||||
[readable-stream-url]: https://nodejs.org/api/stream.html#stream_readable_streams
|
||||
|
||||
[downloads-image]: http://img.shields.io/npm/dm/glob-stream.svg
|
||||
[npm-url]: https://www.npmjs.com/package/glob-stream
|
||||
[npm-image]: http://img.shields.io/npm/v/glob-stream.svg
|
||||
|
||||
[travis-url]: https://travis-ci.org/gulpjs/glob-stream
|
||||
[travis-image]: http://img.shields.io/travis/gulpjs/glob-stream.svg?label=travis-ci
|
||||
|
||||
[appveyor-url]: https://ci.appveyor.com/project/gulpjs/glob-stream
|
||||
[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/glob-stream.svg?label=appveyor
|
||||
|
||||
[coveralls-url]: https://coveralls.io/r/gulpjs/glob-stream
|
||||
[coveralls-image]: http://img.shields.io/coveralls/gulpjs/glob-stream.svg
|
||||
|
||||
[gitter-url]: https://gitter.im/gulpjs/gulp
|
||||
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg
|
94
node_modules/glob-stream/index.js
generated
vendored
Normal file
94
node_modules/glob-stream/index.js
generated
vendored
Normal file
@ -0,0 +1,94 @@
|
||||
'use strict';
|
||||
|
||||
var Combine = require('ordered-read-streams');
|
||||
var unique = require('unique-stream');
|
||||
var pumpify = require('pumpify');
|
||||
var isNegatedGlob = require('is-negated-glob');
|
||||
var extend = require('extend');
|
||||
|
||||
var GlobStream = require('./readable');
|
||||
|
||||
function globStream(globs, opt) {
|
||||
if (!opt) {
|
||||
opt = {};
|
||||
}
|
||||
|
||||
var ourOpt = extend({}, opt);
|
||||
var ignore = ourOpt.ignore;
|
||||
|
||||
ourOpt.cwd = typeof ourOpt.cwd === 'string' ? ourOpt.cwd : process.cwd();
|
||||
ourOpt.dot = typeof ourOpt.dot === 'boolean' ? ourOpt.dot : false;
|
||||
ourOpt.silent = typeof ourOpt.silent === 'boolean' ? ourOpt.silent : true;
|
||||
ourOpt.cwdbase = typeof ourOpt.cwdbase === 'boolean' ? ourOpt.cwdbase : false;
|
||||
ourOpt.uniqueBy = typeof ourOpt.uniqueBy === 'string' ||
|
||||
typeof ourOpt.uniqueBy === 'function' ? ourOpt.uniqueBy : 'path';
|
||||
|
||||
if (ourOpt.cwdbase) {
|
||||
ourOpt.base = ourOpt.cwd;
|
||||
}
|
||||
// Normalize string `ignore` to array
|
||||
if (typeof ignore === 'string') {
|
||||
ignore = [ignore];
|
||||
}
|
||||
// Ensure `ignore` is an array
|
||||
if (!Array.isArray(ignore)) {
|
||||
ignore = [];
|
||||
}
|
||||
|
||||
// Only one glob no need to aggregate
|
||||
if (!Array.isArray(globs)) {
|
||||
globs = [globs];
|
||||
}
|
||||
|
||||
var positives = [];
|
||||
var negatives = [];
|
||||
|
||||
globs.forEach(sortGlobs);
|
||||
|
||||
function sortGlobs(globString, index) {
|
||||
if (typeof globString !== 'string') {
|
||||
throw new Error('Invalid glob at index ' + index);
|
||||
}
|
||||
|
||||
var glob = isNegatedGlob(globString);
|
||||
var globArray = glob.negated ? negatives : positives;
|
||||
|
||||
globArray.push({
|
||||
index: index,
|
||||
glob: glob.pattern,
|
||||
});
|
||||
}
|
||||
|
||||
if (positives.length === 0) {
|
||||
throw new Error('Missing positive glob');
|
||||
}
|
||||
|
||||
// Create all individual streams
|
||||
var streams = positives.map(streamFromPositive);
|
||||
|
||||
// Then just pipe them to a single unique stream and return it
|
||||
var aggregate = new Combine(streams);
|
||||
var uniqueStream = unique(ourOpt.uniqueBy);
|
||||
|
||||
return pumpify.obj(aggregate, uniqueStream);
|
||||
|
||||
function streamFromPositive(positive) {
|
||||
var negativeGlobs = negatives
|
||||
.filter(indexGreaterThan(positive.index))
|
||||
.map(toGlob)
|
||||
.concat(ignore);
|
||||
return new GlobStream(positive.glob, negativeGlobs, ourOpt);
|
||||
}
|
||||
}
|
||||
|
||||
function indexGreaterThan(index) {
|
||||
return function(obj) {
|
||||
return obj.index > index;
|
||||
};
|
||||
}
|
||||
|
||||
function toGlob(obj) {
|
||||
return obj.glob;
|
||||
}
|
||||
|
||||
module.exports = globStream;
|
101
node_modules/glob-stream/package.json
generated
vendored
Normal file
101
node_modules/glob-stream/package.json
generated
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
{
|
||||
"_from": "glob-stream@^6.1.0",
|
||||
"_id": "glob-stream@6.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=",
|
||||
"_location": "/glob-stream",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "glob-stream@^6.1.0",
|
||||
"name": "glob-stream",
|
||||
"escapedName": "glob-stream",
|
||||
"rawSpec": "^6.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^6.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/help-me"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz",
|
||||
"_shasum": "7045c99413b3eb94888d83ab46d0b404cc7bdde4",
|
||||
"_spec": "glob-stream@^6.1.0",
|
||||
"_where": "/home/wn/workspace-node/PiAlive/node_modules/help-me",
|
||||
"author": {
|
||||
"name": "Gulp Team",
|
||||
"email": "team@gulpjs.com",
|
||||
"url": "http://gulpjs.com/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/gulpjs/glob-stream/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Eric Schoffstall",
|
||||
"email": "yo@contra.io"
|
||||
},
|
||||
{
|
||||
"name": "Blaine Bublitz",
|
||||
"email": "blaine.bublitz@gmail.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"extend": "^3.0.0",
|
||||
"glob": "^7.1.1",
|
||||
"glob-parent": "^3.1.0",
|
||||
"is-negated-glob": "^1.0.0",
|
||||
"ordered-read-streams": "^1.0.0",
|
||||
"pumpify": "^1.3.5",
|
||||
"readable-stream": "^2.1.5",
|
||||
"remove-trailing-separator": "^1.0.1",
|
||||
"to-absolute-glob": "^2.0.0",
|
||||
"unique-stream": "^2.0.2"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "A Readable Stream interface over node-glob.",
|
||||
"devDependencies": {
|
||||
"eslint": "^1.10.3",
|
||||
"eslint-config-gulp": "^2.0.0",
|
||||
"expect": "^1.19.0",
|
||||
"istanbul": "^0.4.3",
|
||||
"istanbul-coveralls": "^1.0.3",
|
||||
"jscs": "^2.4.0",
|
||||
"jscs-preset-gulp": "^1.0.0",
|
||||
"mississippi": "^1.2.0",
|
||||
"mocha": "^2.4.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"readable.js",
|
||||
"LICENSE"
|
||||
],
|
||||
"homepage": "https://github.com/gulpjs/glob-stream#readme",
|
||||
"keywords": [
|
||||
"glob",
|
||||
"stream",
|
||||
"gulp",
|
||||
"readable",
|
||||
"fs",
|
||||
"files"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "glob-stream",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/gulpjs/glob-stream.git"
|
||||
},
|
||||
"scripts": {
|
||||
"cover": "istanbul cover _mocha --report lcovonly",
|
||||
"coveralls": "npm run cover && istanbul-coveralls",
|
||||
"lint": "eslint . && jscs index.js readable.js test/",
|
||||
"pretest": "npm run lint",
|
||||
"test": "mocha --async-only"
|
||||
},
|
||||
"version": "6.1.0"
|
||||
}
|
117
node_modules/glob-stream/readable.js
generated
vendored
Normal file
117
node_modules/glob-stream/readable.js
generated
vendored
Normal file
@ -0,0 +1,117 @@
|
||||
'use strict';
|
||||
|
||||
var inherits = require('util').inherits;
|
||||
|
||||
var glob = require('glob');
|
||||
var extend = require('extend');
|
||||
var Readable = require('readable-stream').Readable;
|
||||
var globParent = require('glob-parent');
|
||||
var toAbsoluteGlob = require('to-absolute-glob');
|
||||
var removeTrailingSeparator = require('remove-trailing-separator');
|
||||
|
||||
var globErrMessage1 = 'File not found with singular glob: ';
|
||||
var globErrMessage2 = ' (if this was purposeful, use `allowEmpty` option)';
|
||||
|
||||
function getBasePath(ourGlob, opt) {
|
||||
return globParent(toAbsoluteGlob(ourGlob, opt));
|
||||
}
|
||||
|
||||
function globIsSingular(glob) {
|
||||
var globSet = glob.minimatch.set;
|
||||
if (globSet.length !== 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return globSet[0].every(function isString(value) {
|
||||
return typeof value === 'string';
|
||||
});
|
||||
}
|
||||
|
||||
function GlobStream(ourGlob, negatives, opt) {
|
||||
if (!(this instanceof GlobStream)) {
|
||||
return new GlobStream(ourGlob, negatives, opt);
|
||||
}
|
||||
|
||||
var ourOpt = extend({}, opt);
|
||||
|
||||
Readable.call(this, {
|
||||
objectMode: true,
|
||||
highWaterMark: ourOpt.highWaterMark || 16,
|
||||
});
|
||||
|
||||
// Delete `highWaterMark` after inheriting from Readable
|
||||
delete ourOpt.highWaterMark;
|
||||
|
||||
var self = this;
|
||||
|
||||
function resolveNegatives(negative) {
|
||||
return toAbsoluteGlob(negative, ourOpt);
|
||||
}
|
||||
|
||||
var ourNegatives = negatives.map(resolveNegatives);
|
||||
ourOpt.ignore = ourNegatives;
|
||||
|
||||
var cwd = ourOpt.cwd;
|
||||
var allowEmpty = ourOpt.allowEmpty || false;
|
||||
|
||||
// Extract base path from glob
|
||||
var basePath = ourOpt.base || getBasePath(ourGlob, ourOpt);
|
||||
|
||||
// Remove path relativity to make globs make sense
|
||||
ourGlob = toAbsoluteGlob(ourGlob, ourOpt);
|
||||
// Delete `root` after all resolving done
|
||||
delete ourOpt.root;
|
||||
|
||||
var globber = new glob.Glob(ourGlob, ourOpt);
|
||||
this._globber = globber;
|
||||
|
||||
var found = false;
|
||||
|
||||
globber.on('match', function(filepath) {
|
||||
found = true;
|
||||
var obj = {
|
||||
cwd: cwd,
|
||||
base: basePath,
|
||||
path: removeTrailingSeparator(filepath),
|
||||
};
|
||||
if (!self.push(obj)) {
|
||||
globber.pause();
|
||||
}
|
||||
});
|
||||
|
||||
globber.once('end', function() {
|
||||
if (allowEmpty !== true && !found && globIsSingular(globber)) {
|
||||
var err = new Error(globErrMessage1 + ourGlob + globErrMessage2);
|
||||
|
||||
return self.destroy(err);
|
||||
}
|
||||
|
||||
self.push(null);
|
||||
});
|
||||
|
||||
function onError(err) {
|
||||
self.destroy(err);
|
||||
}
|
||||
|
||||
globber.once('error', onError);
|
||||
}
|
||||
inherits(GlobStream, Readable);
|
||||
|
||||
GlobStream.prototype._read = function() {
|
||||
this._globber.resume();
|
||||
};
|
||||
|
||||
GlobStream.prototype.destroy = function(err) {
|
||||
var self = this;
|
||||
|
||||
this._globber.abort();
|
||||
|
||||
process.nextTick(function() {
|
||||
if (err) {
|
||||
self.emit('error', err);
|
||||
}
|
||||
self.emit('close');
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = GlobStream;
|
Reference in New Issue
Block a user