use directories for structure
This commit is contained in:
21
node_modules/lead/LICENSE
generated
vendored
Normal file
21
node_modules/lead/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 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.
|
55
node_modules/lead/README.md
generated
vendored
Normal file
55
node_modules/lead/README.md
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
<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>
|
||||
|
||||
# lead
|
||||
|
||||
[![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]
|
||||
|
||||
Sink your streams.
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var from = require('from2');
|
||||
var through = require('through2');
|
||||
var sink = require('lead');
|
||||
|
||||
// Might be used as a Transform or Writeable
|
||||
var maybeThrough = through(function(chunk, enc, cb) {
|
||||
// processing
|
||||
cb(null, chunk);
|
||||
});
|
||||
|
||||
from(['hello', 'world'])
|
||||
// Sink it to behave like a Writeable
|
||||
.pipe(sink(maybeThrough))
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### `sink(stream)`
|
||||
|
||||
Takes a `stream` to sink and returns the same stream. Sets up event listeners to infer if the stream is being used as a `Transform` or `Writeable` stream and sinks it on `nextTick` if necessary. If the stream is being used as a `Transform` stream but becomes unpiped, it will be sunk. Respects `pipe`, `on('data')` and `on('readable')` handlers.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
[downloads-image]: http://img.shields.io/npm/dm/lead.svg
|
||||
[npm-url]: https://npmjs.com/package/lead
|
||||
[npm-image]: http://img.shields.io/npm/v/lead.svg
|
||||
|
||||
[travis-url]: https://travis-ci.org/gulpjs/lead
|
||||
[travis-image]: http://img.shields.io/travis/gulpjs/lead.svg?label=travis-ci
|
||||
|
||||
[appveyor-url]: https://ci.appveyor.com/project/gulpjs/lead
|
||||
[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/lead.svg?label=appveyor
|
||||
|
||||
[coveralls-url]: https://coveralls.io/r/gulpjs/lead
|
||||
[coveralls-image]: http://img.shields.io/coveralls/gulpjs/lead/master.svg
|
||||
|
||||
[gitter-url]: https://gitter.im/gulpjs/gulp
|
||||
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.png
|
61
node_modules/lead/index.js
generated
vendored
Normal file
61
node_modules/lead/index.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
'use strict';
|
||||
|
||||
var Writable = require('flush-write-stream');
|
||||
|
||||
function listenerCount(stream, evt) {
|
||||
return stream.listeners(evt).length;
|
||||
}
|
||||
|
||||
function hasListeners(stream) {
|
||||
return !!(listenerCount(stream, 'readable') || listenerCount(stream, 'data'));
|
||||
}
|
||||
|
||||
function sinker(file, enc, callback) {
|
||||
callback();
|
||||
}
|
||||
|
||||
function sink(stream) {
|
||||
var sinkAdded = false;
|
||||
|
||||
var sinkOptions = {
|
||||
objectMode: stream._readableState.objectMode,
|
||||
};
|
||||
|
||||
var sinkStream = new Writable(sinkOptions, sinker);
|
||||
|
||||
function addSink() {
|
||||
if (sinkAdded) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (hasListeners(stream)) {
|
||||
return;
|
||||
}
|
||||
|
||||
sinkAdded = true;
|
||||
stream.pipe(sinkStream);
|
||||
}
|
||||
|
||||
function removeSink(evt) {
|
||||
if (evt !== 'readable' && evt !== 'data') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (hasListeners(stream)) {
|
||||
sinkAdded = false;
|
||||
stream.unpipe(sinkStream);
|
||||
}
|
||||
}
|
||||
|
||||
stream.on('newListener', removeSink);
|
||||
stream.on('removeListener', removeSink);
|
||||
stream.on('removeListener', addSink);
|
||||
|
||||
// Sink the stream to start flowing
|
||||
// Do this on nextTick, it will flow at slowest speed of piped streams
|
||||
process.nextTick(addSink);
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
module.exports = sink;
|
89
node_modules/lead/package.json
generated
vendored
Normal file
89
node_modules/lead/package.json
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"lead@1.0.0",
|
||||
"D:\\Projects\\siag\\vanillajs-seed"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "lead@1.0.0",
|
||||
"_id": "lead@1.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=",
|
||||
"_location": "/lead",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "lead@1.0.0",
|
||||
"name": "lead",
|
||||
"escapedName": "lead",
|
||||
"rawSpec": "1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/vinyl-fs"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz",
|
||||
"_spec": "1.0.0",
|
||||
"_where": "D:\\Projects\\siag\\vanillajs-seed",
|
||||
"author": {
|
||||
"name": "Gulp Team",
|
||||
"email": "team@gulpjs.com",
|
||||
"url": "http://gulpjs.com/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/gulpjs/lead/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Blaine Bublitz",
|
||||
"email": "blaine.bublitz@gmail.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"flush-write-stream": "^1.0.2"
|
||||
},
|
||||
"description": "Sink your streams.",
|
||||
"devDependencies": {
|
||||
"eslint": "^1.10.3",
|
||||
"eslint-config-gulp": "^2.0.0",
|
||||
"expect": "^1.20.2",
|
||||
"istanbul": "^0.4.3",
|
||||
"istanbul-coveralls": "^1.0.3",
|
||||
"jscs": "^2.4.0",
|
||||
"jscs-preset-gulp": "^1.0.0",
|
||||
"mississippi": "^1.3.0",
|
||||
"mocha": "^3.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/gulpjs/lead#readme",
|
||||
"keywords": [
|
||||
"streams",
|
||||
"sink",
|
||||
"through",
|
||||
"writeable"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "lead",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/gulpjs/lead.git"
|
||||
},
|
||||
"scripts": {
|
||||
"cover": "istanbul cover _mocha --report lcovonly",
|
||||
"coveralls": "npm run cover && istanbul-coveralls",
|
||||
"lint": "eslint index.js test/ && jscs index.js test/",
|
||||
"pretest": "npm run lint",
|
||||
"test": "mocha --async-only"
|
||||
},
|
||||
"version": "1.0.0"
|
||||
}
|
Reference in New Issue
Block a user