refactor(Cypress): add nodemodules
This commit is contained in:
6
node_modules/read-only-stream/.travis.yml
generated
vendored
Normal file
6
node_modules/read-only-stream/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.8"
|
||||
- "0.10"
|
||||
before_install:
|
||||
- npm install -g npm@~1.4.6
|
18
node_modules/read-only-stream/LICENSE
generated
vendored
Normal file
18
node_modules/read-only-stream/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
This software is released under the MIT license:
|
||||
|
||||
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.
|
3
node_modules/read-only-stream/example/main.js
generated
vendored
Normal file
3
node_modules/read-only-stream/example/main.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
var wrap = require('./wrap.js');
|
||||
var ro = wrap(); // can't write to `ro` and muck up internal state
|
||||
ro.pipe(process.stdout);
|
8
node_modules/read-only-stream/example/wrap.js
generated
vendored
Normal file
8
node_modules/read-only-stream/example/wrap.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
var through = require('through2');
|
||||
var readonly = require('../');
|
||||
|
||||
module.exports = function () {
|
||||
var stream = through();
|
||||
stream.end('wooooo\n');
|
||||
return readonly(stream);
|
||||
};
|
30
node_modules/read-only-stream/index.js
generated
vendored
Normal file
30
node_modules/read-only-stream/index.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
var Readable = require('readable-stream').Readable;
|
||||
|
||||
module.exports = function (stream) {
|
||||
var opts = stream._readableState;
|
||||
if (typeof stream.read !== 'function') {
|
||||
stream = new Readable(opts).wrap(stream);
|
||||
}
|
||||
|
||||
var ro = new Readable({ objectMode: opts && opts.objectMode });
|
||||
var waiting = false;
|
||||
|
||||
stream.on('readable', function () {
|
||||
if (waiting) {
|
||||
waiting = false;
|
||||
ro._read();
|
||||
}
|
||||
});
|
||||
|
||||
ro._read = function () {
|
||||
var buf, reads = 0;
|
||||
while ((buf = stream.read()) !== null) {
|
||||
ro.push(buf);
|
||||
reads ++;
|
||||
}
|
||||
if (reads === 0) waiting = true;
|
||||
};
|
||||
stream.once('end', function () { ro.push(null) });
|
||||
stream.on('error', function (err) { ro.emit('error', err) });
|
||||
return ro;
|
||||
};
|
63
node_modules/read-only-stream/package.json
generated
vendored
Normal file
63
node_modules/read-only-stream/package.json
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"_from": "read-only-stream@^2.0.0",
|
||||
"_id": "read-only-stream@2.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=",
|
||||
"_location": "/read-only-stream",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "read-only-stream@^2.0.0",
|
||||
"name": "read-only-stream",
|
||||
"escapedName": "read-only-stream",
|
||||
"rawSpec": "^2.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^2.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/browserify"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz",
|
||||
"_shasum": "2724fd6a8113d73764ac288d4386270c1dbf17f0",
|
||||
"_spec": "read-only-stream@^2.0.0",
|
||||
"_where": "/home/simon/Documents/lifen-autotest/node_modules/browserify",
|
||||
"author": {
|
||||
"name": "James Halliday",
|
||||
"email": "mail@substack.net",
|
||||
"url": "http://substack.net"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/substack/read-only-stream/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"readable-stream": "^2.0.2"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "wrap a readable/writable stream to be read-only",
|
||||
"devDependencies": {
|
||||
"concat-stream": "^1.4.6",
|
||||
"covert": "^1.0.0",
|
||||
"tape": "^4.2.0",
|
||||
"through": "^2.3.4",
|
||||
"through2": "^2.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/substack/read-only-stream",
|
||||
"keywords": [
|
||||
"stream",
|
||||
"readonly"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "read-only-stream",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/substack/read-only-stream.git"
|
||||
},
|
||||
"scripts": {
|
||||
"coverage": "covert test/*.js",
|
||||
"test": "tape test/*.js"
|
||||
},
|
||||
"version": "2.0.0"
|
||||
}
|
60
node_modules/read-only-stream/readme.markdown
generated
vendored
Normal file
60
node_modules/read-only-stream/readme.markdown
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
# read-only-stream
|
||||
|
||||
wrap a readable/writable stream to be read-only
|
||||
to prevent mucking up the input side
|
||||
|
||||
[](http://travis-ci.org/substack/read-only-stream)
|
||||
|
||||
# example
|
||||
|
||||
Suppose you have a module that uses a readable/writable stream internally but
|
||||
want to expose just the readable part of that internal stream. This is common if
|
||||
you use the writable side internally and expose the readable side as the
|
||||
interface.
|
||||
|
||||
Now we can write some code like this with a `through` stream internally for
|
||||
convenience:
|
||||
|
||||
``` js
|
||||
var through = require('through2');
|
||||
var readonly = require('read-only-stream');
|
||||
|
||||
module.exports = function () {
|
||||
var stream = through();
|
||||
stream.end('wooooo\n');
|
||||
return readonly(stream);
|
||||
};
|
||||
```
|
||||
|
||||
but consumers won't be able to write to the input side and break the api:
|
||||
|
||||
``` js
|
||||
var wrap = require('./wrap.js');
|
||||
var ro = wrap(); // can't write to `ro` and muck up internal state
|
||||
ro.pipe(process.stdout);
|
||||
```
|
||||
|
||||
# methods
|
||||
|
||||
``` js
|
||||
var readonly = require('read-only-stream')
|
||||
```
|
||||
|
||||
## var ro = readonly(stream)
|
||||
|
||||
Return a readable stream `ro` that wraps the readable/writable `stream` argument
|
||||
given to only expose the readable side.
|
||||
|
||||
`stream` can be a streams1 or streams2 stream.
|
||||
|
||||
# install
|
||||
|
||||
With [npm](https://npmjs.org) do:
|
||||
|
||||
```
|
||||
npm install read-only-stream
|
||||
```
|
||||
|
||||
# license
|
||||
|
||||
MIT
|
15
node_modules/read-only-stream/test/error.js
generated
vendored
Normal file
15
node_modules/read-only-stream/test/error.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
var test = require('tape');
|
||||
var readonly = require('../');
|
||||
var through = require('through2');
|
||||
|
||||
test('error', function (t) {
|
||||
t.plan(1);
|
||||
|
||||
var stream = through();
|
||||
var ro = readonly(stream);
|
||||
|
||||
ro.on('error', function (err) {
|
||||
t.ok(err);
|
||||
});
|
||||
stream.emit('error', new Error);
|
||||
});
|
22
node_modules/read-only-stream/test/ro.js
generated
vendored
Normal file
22
node_modules/read-only-stream/test/ro.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
var test = require('tape');
|
||||
var readonly = require('../');
|
||||
var through = require('through2');
|
||||
var concat = require('concat-stream');
|
||||
|
||||
test('readonly', function (t) {
|
||||
t.plan(2);
|
||||
|
||||
var stream = through();
|
||||
stream.write('woo');
|
||||
|
||||
var ro = readonly(stream);
|
||||
ro.pipe(concat(function (body) {
|
||||
t.equal(body.toString('utf8'), 'woo');
|
||||
}));
|
||||
|
||||
t.throws(function () {
|
||||
ro.write('beep');
|
||||
});
|
||||
|
||||
stream.end();
|
||||
});
|
21
node_modules/read-only-stream/test/streams1.js
generated
vendored
Normal file
21
node_modules/read-only-stream/test/streams1.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
var test = require('tape');
|
||||
var readonly = require('../');
|
||||
var through = require('through');
|
||||
var concat = require('concat-stream');
|
||||
|
||||
test('streams1', function (t) {
|
||||
t.plan(2);
|
||||
|
||||
var stream = through();
|
||||
|
||||
var ro = readonly(stream);
|
||||
ro.pipe(concat(function (body) {
|
||||
t.equal(body.toString('utf8'), 'woo');
|
||||
}));
|
||||
|
||||
t.throws(function () {
|
||||
ro.write('beep');
|
||||
});
|
||||
|
||||
stream.end('woo');
|
||||
});
|
Reference in New Issue
Block a user