diff options
Diffstat (limited to 'deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream')
8 files changed, 0 insertions, 302 deletions
diff --git a/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/.npmignore b/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/.npmignore deleted file mode 100644 index 3e70011a19..0000000000 --- a/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -bundle.js -test.html diff --git a/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/.travis.yml b/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/.travis.yml deleted file mode 100644 index c042821703..0000000000 --- a/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - '0.10' - - '0.12' - - '4.0' - - '5.0' diff --git a/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/LICENSE b/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/LICENSE deleted file mode 100644 index 66a4d2a149..0000000000 --- a/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 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/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/README.md b/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/README.md deleted file mode 100644 index 7ea7b699b8..0000000000 --- a/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# flush-write-stream - -A write stream constructor that supports a flush function that is called before `finish` is emitted - -``` -npm install flush-write-stream -``` - -[![build status](http://img.shields.io/travis/mafintosh/flush-write-stream.svg?style=flat)](http://travis-ci.org/mafintosh/flush-write-stream) - -## Usage - -``` js -var writer = require('flush-write-stream') - -var ws = writer(write, flush) - -ws.on('finish', function () { - console.log('finished') -}) - -ws.write('hello') -ws.write('world') -ws.end() - -function write (data, enc, cb) { - // i am your normal ._write method - console.log('writing', data.toString()) - cb() -} - -function flush (cb) { - // i am called before finish is emitted - setTimeout(cb, 1000) // wait 1 sec -} -``` - -If you run the above it will produce the following output - -``` -writing hello -writing world -(nothing happens for 1 sec) -finished -``` - -## API - -#### `var ws = writer([options], write, [flush])` - -Create a new writable stream. Options are forwarded to the stream constructor. - -#### `var ws = writer.obj([options], write, [flush])` - -Same as the above except `objectMode` is set to `true` per default. - -## License - -MIT diff --git a/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/example.js b/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/example.js deleted file mode 100644 index fa6b5dab25..0000000000 --- a/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/example.js +++ /dev/null @@ -1,22 +0,0 @@ -var writer = require('./') - -var ws = writer(write, flush) - -ws.on('finish', function () { - console.log('finished') -}) - -ws.write('hello') -ws.write('world') -ws.end() - -function write (data, enc, cb) { - // i am your normal ._write method - console.log('writing', data.toString()) - cb() -} - -function flush (cb) { - // i am called before finish is emitted - setTimeout(cb, 1000) // wait 1 sec -} diff --git a/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/index.js b/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/index.js deleted file mode 100644 index e82e126126..0000000000 --- a/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/index.js +++ /dev/null @@ -1,52 +0,0 @@ -var stream = require('readable-stream') -var inherits = require('inherits') - -var SIGNAL_FLUSH = new Buffer([0]) - -module.exports = WriteStream - -function WriteStream (opts, write, flush) { - if (!(this instanceof WriteStream)) return new WriteStream(opts, write, flush) - - if (typeof opts === 'function') { - flush = write - write = opts - opts = {} - } - - stream.Writable.call(this, opts) - - this.destroyed = false - this._worker = write || null - this._flush = flush || null -} - -inherits(WriteStream, stream.Writable) - -WriteStream.obj = function (opts, worker, flush) { - if (typeof opts === 'function') return WriteStream.obj(null, opts, worker) - if (!opts) opts = {} - opts.objectMode = true - return new WriteStream(opts, worker, flush) -} - -WriteStream.prototype._write = function (data, enc, cb) { - if (SIGNAL_FLUSH === data) this._flush(cb) - else this._worker(data, enc, cb) -} - -WriteStream.prototype.end = function (data, enc, cb) { - if (!this._flush) return stream.Writable.prototype.end.apply(this, arguments) - if (typeof data === 'function') return this.end(null, null, data) - if (typeof enc === 'function') return this.end(data, null, enc) - if (data) this.write(data) - if (!this._writableState.ending) this.write(SIGNAL_FLUSH) - return stream.Writable.prototype.end.call(this, cb) -} - -WriteStream.prototype.destroy = function (err) { - if (this.destroyed) return - this.destroyed = true - if (err) this.emit('error', err) - this.emit('close') -} diff --git a/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/package.json b/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/package.json deleted file mode 100644 index 0fc9c77ed5..0000000000 --- a/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "_from": "flush-write-stream@^1.0.0", - "_id": "flush-write-stream@1.0.2", - "_inBundle": false, - "_integrity": "sha1-yBuQ2HRnZvGmCaRoCZRsRd2K5Bc=", - "_location": "/cacache/mississippi/flush-write-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "flush-write-stream@^1.0.0", - "name": "flush-write-stream", - "escapedName": "flush-write-stream", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/cacache/mississippi" - ], - "_resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.2.tgz", - "_shasum": "c81b90d8746766f1a609a46809946c45dd8ae417", - "_spec": "flush-write-stream@^1.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/cacache/node_modules/mississippi", - "author": { - "name": "Mathias Buus", - "url": "@mafintosh" - }, - "bugs": { - "url": "https://github.com/mafintosh/flush-write-stream/issues" - }, - "bundleDependencies": false, - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.4" - }, - "deprecated": false, - "description": "A write stream constructor that supports a flush function that is called before finish is emitted", - "devDependencies": { - "tape": "^4.2.2" - }, - "homepage": "https://github.com/mafintosh/flush-write-stream", - "license": "MIT", - "main": "index.js", - "name": "flush-write-stream", - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/flush-write-stream.git" - }, - "scripts": { - "test": "tape test.js" - }, - "version": "1.0.2" -} diff --git a/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/test.js b/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/test.js deleted file mode 100644 index 6cd0c20e1f..0000000000 --- a/deps/npm/node_modules/cacache/node_modules/mississippi/node_modules/flush-write-stream/test.js +++ /dev/null @@ -1,85 +0,0 @@ -var tape = require('tape') -var writer = require('./') - -tape('is a write stream', function (t) { - var expected = ['hello', 'world', 'verden'] - var ws = writer.obj(write) - - ws.write('hello') - ws.write('world') - ws.write('verden') - ws.end(function () { - t.same(expected.length, 0) - t.end() - }) - - function write (data, enc, cb) { - t.same(data, expected.shift()) - cb() - } -}) - -tape('is flushable', function (t) { - var expected = ['hello', 'world', 'verden'] - var flushed = false - - var ws = writer.obj(write, flush) - - ws.write('hello') - ws.write('world') - ws.write('verden') - ws.end(function () { - t.same(expected.length, 0) - t.ok(flushed, 'was flushed') - t.end() - }) - - function write (data, enc, cb) { - t.same(data, expected.shift()) - cb() - } - - function flush (cb) { - flushed = true - process.nextTick(cb) - } -}) - -tape('can pass options', function (t) { - var expected = ['hello', 'world', 'verden'] - var flushed = false - - var ws = writer({objectMode: true}, write, flush) - - ws.write('hello') - ws.write('world') - ws.write('verden') - ws.end(function () { - t.same(expected.length, 0) - t.ok(flushed, 'was flushed') - t.end() - }) - - function write (data, enc, cb) { - t.same(data, expected.shift()) - cb() - } - - function flush (cb) { - flushed = true - process.nextTick(cb) - } -}) - -tape('emits error on destroy', function (t) { - var expected = new Error() - - var ws = writer({objectMode: true}, function () {}) - - ws.on('error', function (err) { - t.equal(err, expected) - }) - ws.on('close', t.end) - - ws.destroy(expected) -}) |