summaryrefslogtreecommitdiff
path: root/node_modules/gather-stream
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2026-05-18 23:10:59 +0800
committerlittleblack111 <littleblack11111@gmail.com>2026-05-18 23:41:44 +0800
commitfc87c009806dcc98867f6b58efe29b042aa01dee (patch)
tree8f59b3f4a5b66e9dfef2d40c8d318e258a521228 /node_modules/gather-stream
parent3336b2356ee6152d9c6ae59bd9b87ccbc0958407 (diff)
node: updatemain
Diffstat (limited to 'node_modules/gather-stream')
-rw-r--r--node_modules/gather-stream/README.md32
-rw-r--r--node_modules/gather-stream/index.js44
-rw-r--r--node_modules/gather-stream/package.json24
3 files changed, 0 insertions, 100 deletions
diff --git a/node_modules/gather-stream/README.md b/node_modules/gather-stream/README.md
deleted file mode 100644
index c3142fec..00000000
--- a/node_modules/gather-stream/README.md
+++ /dev/null
@@ -1,32 +0,0 @@
-# gather-stream
-
-Basically [concat-stream](https://github.com/maxogden/concat-stream) but minimaller implementation, and/but also with error handling.
-
-
-## Usage
-
-Here's a simple example:
-
- var concat2 = require('gather-stream'),
- fs = require('fs');
-
- fs.createReadStream('README.md').pipe(concat2(function (error,buffer) {
- if (error) console.error(error);
- else console.log("Read file, it was %s bytes long.", buffer.length);
- });
-
-
-## API
-
-* `var concat2 = require('gather-stream')` — the module exports a single wrapper function
-* `concat2([opts, ]cb)` — returns a Writable stream you can pipe into. If an error occurs on this stream *or* its source, `cb(error)` will be called; otherwise `cb(null, buffer)` will get you. You can provide `{maxLength:someNumberOfBytes}` as `opts` to limit memory mayhem if you wish — if the limit is about to be exceeded, an error will be fired instead.
-* that's about it
-
-
-## License
-
-Copyright © 2014, Nathan Vander Wilt
-
-Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/gather-stream/index.js b/node_modules/gather-stream/index.js
deleted file mode 100644
index cab8bda9..00000000
--- a/node_modules/gather-stream/index.js
+++ /dev/null
@@ -1,44 +0,0 @@
-var Writable = require('stream').Writable,
- util = require('util');
-
-function Gatherer(opts) {
- opts.decodeStrings = true;
- Writable.call(this, opts);
- this._length = 0;
- this._chunks = [];
- this._maxLength = ('maxLength' in opts) ? opts.maxLength : Infinity;
-}
-
-util.inherits(Gatherer, Writable);
-
-Gatherer.prototype._write = function (d, _enc, cb) {
- if (this._length + d.length > this._maxLength) {
- return cb(new Error("Maximum length exceeded!"));
- }
- this._chunks.push(d);
- this._length += d.length;
- cb();
-}
-
-Gatherer.prototype.getBuffer = function () {
- return Buffer.concat(this._chunks, this._length);
-}
-
-module.exports = function (opts, cb) {
- if (typeof opts === 'function') {
- cb = opts;
- opts = {};
- }
- var target = new Gatherer(opts);
- target.on('error', cb);
- target.on('pipe', function (source) {
- source.on('error', cb);
- });
- target.on('unpipe', function (source) {
- source.removeListener('error', cb);
- });
- target.on('finish', function () {
- cb(null, target.getBuffer());
- });
- return target;
-}
diff --git a/node_modules/gather-stream/package.json b/node_modules/gather-stream/package.json
deleted file mode 100644
index 86bff1e2..00000000
--- a/node_modules/gather-stream/package.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "gather-stream",
- "version": "1.0.0",
- "description": "Gather a stream, callback with buffer (or error) when done",
- "main": "index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/natevw/gather-stream.git"
- },
- "keywords": [
- "stream",
- "buffer",
- "pipe"
- ],
- "author": "Nathan Vander Wilt",
- "license": "ISC",
- "bugs": {
- "url": "https://github.com/natevw/gather-stream/issues"
- },
- "homepage": "https://github.com/natevw/gather-stream"
-}