mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-13 05:13:33 -06:00
Initial commit
This commit is contained in:
3
node_modules/duplexer/.npmignore
generated
vendored
Normal file
3
node_modules/duplexer/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
node_modules
|
||||
*.log
|
||||
*.err
|
6
node_modules/duplexer/.travis.yml
generated
vendored
Normal file
6
node_modules/duplexer/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.11"
|
||||
- "0.10"
|
||||
- "0.8"
|
||||
- "0.6"
|
19
node_modules/duplexer/LICENCE
generated
vendored
Normal file
19
node_modules/duplexer/LICENCE
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2012 Raynos.
|
||||
|
||||
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.
|
47
node_modules/duplexer/README.md
generated
vendored
Normal file
47
node_modules/duplexer/README.md
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
# duplexer
|
||||
|
||||
[![build status][1]][2] [![dependency status][3]][4]
|
||||
|
||||
[![browser support][5]][6]
|
||||
|
||||
Creates a duplex stream
|
||||
|
||||
Taken from [event-stream][7]
|
||||
|
||||
## duplex (writeStream, readStream)
|
||||
|
||||
Takes a writable stream and a readable stream and makes them appear as a readable writable stream.
|
||||
|
||||
It is assumed that the two streams are connected to each other in some way.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var grep = cp.exec('grep Stream')
|
||||
|
||||
duplex(grep.stdin, grep.stdout)
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
`npm install duplexer`
|
||||
|
||||
## Tests
|
||||
|
||||
`npm test`
|
||||
|
||||
## Contributors
|
||||
|
||||
- Dominictarr
|
||||
- Raynos
|
||||
- samccone
|
||||
|
||||
## MIT Licenced
|
||||
|
||||
[1]: https://secure.travis-ci.org/Raynos/duplexer.png
|
||||
[2]: https://travis-ci.org/Raynos/duplexer
|
||||
[3]: https://david-dm.org/Raynos/duplexer.png
|
||||
[4]: https://david-dm.org/Raynos/duplexer
|
||||
[5]: https://ci.testling.com/Raynos/duplexer.png
|
||||
[6]: https://ci.testling.com/Raynos/duplexer
|
||||
[7]: https://github.com/dominictarr/event-stream#duplex-writestream-readstream
|
87
node_modules/duplexer/index.js
generated
vendored
Normal file
87
node_modules/duplexer/index.js
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
var Stream = require("stream")
|
||||
var writeMethods = ["write", "end", "destroy"]
|
||||
var readMethods = ["resume", "pause"]
|
||||
var readEvents = ["data", "close"]
|
||||
var slice = Array.prototype.slice
|
||||
|
||||
module.exports = duplex
|
||||
|
||||
function forEach (arr, fn) {
|
||||
if (arr.forEach) {
|
||||
return arr.forEach(fn)
|
||||
}
|
||||
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
fn(arr[i], i)
|
||||
}
|
||||
}
|
||||
|
||||
function duplex(writer, reader) {
|
||||
var stream = new Stream()
|
||||
var ended = false
|
||||
|
||||
forEach(writeMethods, proxyWriter)
|
||||
|
||||
forEach(readMethods, proxyReader)
|
||||
|
||||
forEach(readEvents, proxyStream)
|
||||
|
||||
reader.on("end", handleEnd)
|
||||
|
||||
writer.on("drain", function() {
|
||||
stream.emit("drain")
|
||||
})
|
||||
|
||||
writer.on("error", reemit)
|
||||
reader.on("error", reemit)
|
||||
|
||||
stream.writable = writer.writable
|
||||
stream.readable = reader.readable
|
||||
|
||||
return stream
|
||||
|
||||
function proxyWriter(methodName) {
|
||||
stream[methodName] = method
|
||||
|
||||
function method() {
|
||||
return writer[methodName].apply(writer, arguments)
|
||||
}
|
||||
}
|
||||
|
||||
function proxyReader(methodName) {
|
||||
stream[methodName] = method
|
||||
|
||||
function method() {
|
||||
stream.emit(methodName)
|
||||
var func = reader[methodName]
|
||||
if (func) {
|
||||
return func.apply(reader, arguments)
|
||||
}
|
||||
reader.emit(methodName)
|
||||
}
|
||||
}
|
||||
|
||||
function proxyStream(methodName) {
|
||||
reader.on(methodName, reemit)
|
||||
|
||||
function reemit() {
|
||||
var args = slice.call(arguments)
|
||||
args.unshift(methodName)
|
||||
stream.emit.apply(stream, args)
|
||||
}
|
||||
}
|
||||
|
||||
function handleEnd() {
|
||||
if (ended) {
|
||||
return
|
||||
}
|
||||
ended = true
|
||||
var args = slice.call(arguments)
|
||||
args.unshift("end")
|
||||
stream.emit.apply(stream, args)
|
||||
}
|
||||
|
||||
function reemit(err) {
|
||||
stream.emit("error", err)
|
||||
}
|
||||
}
|
105
node_modules/duplexer/package.json
generated
vendored
Normal file
105
node_modules/duplexer/package.json
generated
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"duplexer@~0.1.1",
|
||||
"/Users/pmarsceill/_projects/just-the-docs/node_modules/stream-combiner"
|
||||
]
|
||||
],
|
||||
"_from": "duplexer@>=0.1.1 <0.2.0",
|
||||
"_id": "duplexer@0.1.1",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/duplexer",
|
||||
"_npmUser": {
|
||||
"email": "raynos2@gmail.com",
|
||||
"name": "raynos"
|
||||
},
|
||||
"_npmVersion": "1.2.18",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "duplexer",
|
||||
"raw": "duplexer@~0.1.1",
|
||||
"rawSpec": "~0.1.1",
|
||||
"scope": null,
|
||||
"spec": ">=0.1.1 <0.2.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/stream-combiner"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz",
|
||||
"_shasum": "ace6ff808c1ce66b57d1ebf97977acb02334cfc1",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "duplexer@~0.1.1",
|
||||
"_where": "/Users/pmarsceill/_projects/just-the-docs/node_modules/stream-combiner",
|
||||
"author": {
|
||||
"email": "raynos2@gmail.com",
|
||||
"name": "Raynos"
|
||||
},
|
||||
"bugs": {
|
||||
"email": "raynos2@gmail.com",
|
||||
"url": "https://github.com/Raynos/duplexer/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Jake Verbaten"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"description": "Creates a duplex stream",
|
||||
"devDependencies": {
|
||||
"tape": "0.3.3",
|
||||
"through": "~0.1.4"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "ace6ff808c1ce66b57d1ebf97977acb02334cfc1",
|
||||
"tarball": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz"
|
||||
},
|
||||
"homepage": "https://github.com/Raynos/duplexer",
|
||||
"keywords": [],
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "http://github.com/Raynos/duplexer/raw/master/LICENSE"
|
||||
}
|
||||
],
|
||||
"main": "index",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "raynos",
|
||||
"email": "raynos2@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "dominictarr",
|
||||
"email": "dominic.tarr@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "duplexer",
|
||||
"optionalDependencies": {},
|
||||
"readme": "# duplexer\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n[![browser support][5]][6]\n\nCreates a duplex stream\n\nTaken from [event-stream][7]\n\n## duplex (writeStream, readStream)\n\nTakes a writable stream and a readable stream and makes them appear as a readable writable stream.\n\nIt is assumed that the two streams are connected to each other in some way.\n\n## Example\n\n```js\nvar grep = cp.exec('grep Stream')\n\nduplex(grep.stdin, grep.stdout)\n```\n\n## Installation\n\n`npm install duplexer`\n\n## Tests\n\n`npm test`\n\n## Contributors\n\n - Dominictarr\n - Raynos\n - samccone\n\n## MIT Licenced\n\n [1]: https://secure.travis-ci.org/Raynos/duplexer.png\n [2]: https://travis-ci.org/Raynos/duplexer\n [3]: https://david-dm.org/Raynos/duplexer.png\n [4]: https://david-dm.org/Raynos/duplexer\n [5]: https://ci.testling.com/Raynos/duplexer.png\n [6]: https://ci.testling.com/Raynos/duplexer\n [7]: https://github.com/dominictarr/event-stream#duplex-writestream-readstream\n",
|
||||
"readmeFilename": "README.md",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/Raynos/duplexer.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test"
|
||||
},
|
||||
"testling": {
|
||||
"browsers": [
|
||||
"chrome/22..latest",
|
||||
"chrome/canary",
|
||||
"firefox/16..latest",
|
||||
"firefox/nightly",
|
||||
"ie/8..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"opera/12..latest",
|
||||
"opera/next",
|
||||
"safari/5.1..latest"
|
||||
],
|
||||
"files": "test/index.js"
|
||||
},
|
||||
"version": "0.1.1"
|
||||
}
|
31
node_modules/duplexer/test/index.js
generated
vendored
Normal file
31
node_modules/duplexer/test/index.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
var through = require("through")
|
||||
var test = require("tape")
|
||||
|
||||
var duplex = require("../index")
|
||||
|
||||
var readable = through()
|
||||
var writable = through(write)
|
||||
var written = 0
|
||||
var data = 0
|
||||
|
||||
var stream = duplex(writable, readable)
|
||||
|
||||
function write() {
|
||||
written++
|
||||
}
|
||||
|
||||
stream.on("data", ondata)
|
||||
|
||||
function ondata() {
|
||||
data++
|
||||
}
|
||||
|
||||
test("emit and write", function(t) {
|
||||
t.plan(2)
|
||||
|
||||
stream.write()
|
||||
readable.emit("data")
|
||||
|
||||
t.equal(written, 1, "should have written once")
|
||||
t.equal(data, 1, "should have recived once")
|
||||
})
|
Reference in New Issue
Block a user