aboutsummaryrefslogtreecommitdiff
path: root/node_modules/parallel-transform
diff options
context:
space:
mode:
authorruki <waruqi@gmail.com>2018-11-08 00:43:05 +0800
committerruki <waruqi@gmail.com>2018-11-07 22:18:30 +0800
commit89e95b3f143682ed9a006991bacf45c9dcba4818 (patch)
tree4f44cf41b828577d583890bdd5a1c31e8491a6ba /node_modules/parallel-transform
parentaa7f0199255277949790b41c56e8ec97dd4f0da4 (diff)
downloadxmake-docs-89e95b3f143682ed9a006991bacf45c9dcba4818.tar.gz
xmake-docs-89e95b3f143682ed9a006991bacf45c9dcba4818.zip
remove node_modulesvuepress
Diffstat (limited to 'node_modules/parallel-transform')
-rw-r--r--node_modules/parallel-transform/.npmignore1
-rw-r--r--node_modules/parallel-transform/LICENSE20
-rw-r--r--node_modules/parallel-transform/README.md54
-rw-r--r--node_modules/parallel-transform/index.js105
-rw-r--r--node_modules/parallel-transform/package.json20
5 files changed, 0 insertions, 200 deletions
diff --git a/node_modules/parallel-transform/.npmignore b/node_modules/parallel-transform/.npmignore
deleted file mode 100644
index 3c3629e6..00000000
--- a/node_modules/parallel-transform/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
diff --git a/node_modules/parallel-transform/LICENSE b/node_modules/parallel-transform/LICENSE
deleted file mode 100644
index 4b30ed5d..00000000
--- a/node_modules/parallel-transform/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-Copyright 2013 Mathias Buus
-
-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.
diff --git a/node_modules/parallel-transform/README.md b/node_modules/parallel-transform/README.md
deleted file mode 100644
index f53e1308..00000000
--- a/node_modules/parallel-transform/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-# parallel-transform
-
-[Transform stream](http://nodejs.org/api/stream.html#stream_class_stream_transform_1) for Node.js that allows you to run your transforms
-in parallel without changing the order of the output.
-
- npm install parallel-transform
-
-It is easy to use
-
-``` js
-var transform = require('parallel-transform');
-
-var stream = transform(10, function(data, callback) { // 10 is the parallism level
- setTimeout(function() {
- callback(null, data);
- }, Math.random() * 1000);
-});
-
-for (var i = 0; i < 10; i++) {
- stream.write(''+i);
-}
-stream.end();
-
-stream.on('data', function(data) {
- console.log(data); // prints 0,1,2,...
-});
-stream.on('end', function() {
- console.log('stream has ended');
-});
-```
-
-If you run the above example you'll notice that it runs in parallel
-(does not take ~1 second between each print) and that the order is preserved
-
-## Stream options
-
-All transforms are Node 0.10 streams. Per default they are created with the options `{objectMode:true}`.
-If you want to use your own stream options pass them as the second parameter
-
-``` js
-var stream = transform(10, {objectMode:false}, function(data, callback) {
- // data is now a buffer
- callback(null, data);
-});
-
-fs.createReadStream('filename').pipe(stream).pipe(process.stdout);
-```
-
-### Unordered
-Passing the option `{ordered:false}` will output the data as soon as it's processed by a transform, without waiting to respect the order.
-
-## License
-
-MIT \ No newline at end of file
diff --git a/node_modules/parallel-transform/index.js b/node_modules/parallel-transform/index.js
deleted file mode 100644
index 77329e4c..00000000
--- a/node_modules/parallel-transform/index.js
+++ /dev/null
@@ -1,105 +0,0 @@
-var Transform = require('readable-stream').Transform;
-var inherits = require('inherits');
-var cyclist = require('cyclist');
-var util = require('util');
-
-var ParallelTransform = function(maxParallel, opts, ontransform) {
- if (!(this instanceof ParallelTransform)) return new ParallelTransform(maxParallel, opts, ontransform);
-
- if (typeof maxParallel === 'function') {
- ontransform = maxParallel;
- opts = null;
- maxParallel = 1;
- }
- if (typeof opts === 'function') {
- ontransform = opts;
- opts = null;
- }
-
- if (!opts) opts = {};
- if (!opts.highWaterMark) opts.highWaterMark = Math.max(maxParallel, 16);
- if (opts.objectMode !== false) opts.objectMode = true;
-
- Transform.call(this, opts);
-
- this._maxParallel = maxParallel;
- this._ontransform = ontransform;
- this._destroyed = false;
- this._flushed = false;
- this._ordered = opts.ordered !== false;
- this._buffer = this._ordered ? cyclist(maxParallel) : [];
- this._top = 0;
- this._bottom = 0;
- this._ondrain = null;
-};
-
-inherits(ParallelTransform, Transform);
-
-ParallelTransform.prototype.destroy = function() {
- if (this._destroyed) return;
- this._destroyed = true;
- this.emit('close');
-};
-
-ParallelTransform.prototype._transform = function(chunk, enc, callback) {
- var self = this;
- var pos = this._top++;
-
- this._ontransform(chunk, function(err, data) {
- if (self._destroyed) return;
- if (err) {
- self.emit('error', err);
- self.push(null);
- self.destroy();
- return;
- }
- if (self._ordered) {
- self._buffer.put(pos, (data === undefined || data === null) ? null : data);
- }
- else {
- self._buffer.push(data);
- }
- self._drain();
- });
-
- if (this._top - this._bottom < this._maxParallel) return callback();
- this._ondrain = callback;
-};
-
-ParallelTransform.prototype._flush = function(callback) {
- this._flushed = true;
- this._ondrain = callback;
- this._drain();
-};
-
-ParallelTransform.prototype._drain = function() {
- if (this._ordered) {
- while (this._buffer.get(this._bottom) !== undefined) {
- var data = this._buffer.del(this._bottom++);
- if (data === null) continue;
- this.push(data);
- }
- }
- else {
- while (this._buffer.length > 0) {
- var data = this._buffer.pop();
- this._bottom++;
- if (data === null) continue;
- this.push(data);
- }
- }
-
-
- if (!this._drained() || !this._ondrain) return;
-
- var ondrain = this._ondrain;
- this._ondrain = null;
- ondrain();
-};
-
-ParallelTransform.prototype._drained = function() {
- var diff = this._top - this._bottom;
- return this._flushed ? !diff : diff < this._maxParallel;
-};
-
-module.exports = ParallelTransform;
diff --git a/node_modules/parallel-transform/package.json b/node_modules/parallel-transform/package.json
deleted file mode 100644
index 5c3c570d..00000000
--- a/node_modules/parallel-transform/package.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "parallel-transform",
- "version": "1.1.0",
- "repository": "git://github.com/mafintosh/parallel-transform",
- "license": "MIT",
- "description": "Transform stream that allows you to run your transforms in parallel without changing the order",
- "keywords": [
- "transform",
- "stream",
- "parallel",
- "preserve",
- "order"
- ],
- "author": "Mathias Buus Madsen <mathiasbuus@gmail.com>",
- "dependencies": {
- "cyclist": "~0.2.2",
- "inherits": "^2.0.3",
- "readable-stream": "^2.1.5"
- }
-}