flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
4
VISUALIZACION/node_modules/quote-stream/.travis.yml
generated
vendored
Executable file
4
VISUALIZACION/node_modules/quote-stream/.travis.yml
generated
vendored
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- "0.8"
|
||||
- "0.10"
|
||||
18
VISUALIZACION/node_modules/quote-stream/LICENSE
generated
vendored
Executable file
18
VISUALIZACION/node_modules/quote-stream/LICENSE
generated
vendored
Executable 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.
|
||||
13
VISUALIZACION/node_modules/quote-stream/bin/cmd.js
generated
vendored
Executable file
13
VISUALIZACION/node_modules/quote-stream/bin/cmd.js
generated
vendored
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
var quote = require('../');
|
||||
var minimist = require('minimist');
|
||||
var fs = require('fs');
|
||||
|
||||
var argv = minimist(process.argv.slice(2), { alias: { h: 'help' } });
|
||||
if (argv.help) {
|
||||
var s = fs.createReadStream(__dirname + '/usage.txt');
|
||||
return s.pipe(process.stdout);
|
||||
}
|
||||
|
||||
process.stdin.pipe(quote()).pipe(process.stdout);
|
||||
4
VISUALIZACION/node_modules/quote-stream/bin/usage.txt
generated
vendored
Executable file
4
VISUALIZACION/node_modules/quote-stream/bin/usage.txt
generated
vendored
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
usage: quote-stream
|
||||
|
||||
Transform stdin to a quoted string on stdout.
|
||||
|
||||
2
VISUALIZACION/node_modules/quote-stream/example/stream.js
generated
vendored
Executable file
2
VISUALIZACION/node_modules/quote-stream/example/stream.js
generated
vendored
Executable file
|
|
@ -0,0 +1,2 @@
|
|||
var quote = require('../');
|
||||
process.stdin.pipe(quote()).pipe(process.stdout);
|
||||
92
VISUALIZACION/node_modules/quote-stream/index.js
generated
vendored
Executable file
92
VISUALIZACION/node_modules/quote-stream/index.js
generated
vendored
Executable file
|
|
@ -0,0 +1,92 @@
|
|||
var through = require('through2');
|
||||
var equals = require('buffer-equal')
|
||||
var buffers = {
|
||||
quote: Buffer('"'),
|
||||
escapeQuote: Buffer('\\"'),
|
||||
escapeEscape: Buffer('\\\\'),
|
||||
escapeB: Buffer('\\b'),
|
||||
escapeF: Buffer('\\f'),
|
||||
escapeN: Buffer('\\n'),
|
||||
escapeR: Buffer('\\r'),
|
||||
escapeT: Buffer('\\t'),
|
||||
escapeLineSeparator: Buffer('\\u2028'),
|
||||
escapeParagraphSeparator: Buffer('\\u2029')
|
||||
};
|
||||
|
||||
for (var i = 0; i < 32; i++) {
|
||||
var s = i.toString(16);
|
||||
buffers[i] = Buffer('\\u' + Array(5-s.length).join('0') + s);
|
||||
}
|
||||
|
||||
var codes = {
|
||||
quote: '"'.charCodeAt(0),
|
||||
escape: '\\'.charCodeAt(0),
|
||||
b: '\b'.charCodeAt(0),
|
||||
f: '\f'.charCodeAt(0),
|
||||
n: '\n'.charCodeAt(0),
|
||||
r: '\r'.charCodeAt(0),
|
||||
t: '\t'.charCodeAt(0)
|
||||
};
|
||||
|
||||
var multiByteBuffers = {
|
||||
lineSeparator: Buffer('\u2028', 'utf8'),
|
||||
paragraphSeparator: Buffer('\u2029', 'utf8')
|
||||
};
|
||||
var multiByteSeparatorLength = multiByteBuffers.lineSeparator.length; // same for both
|
||||
var multiByteSeparatorOffset = multiByteSeparatorLength - 1;
|
||||
var multiByteSeparatorCode = multiByteBuffers.lineSeparator[0]; // same for both
|
||||
|
||||
var map = {};
|
||||
map[codes.quote] = buffers.escapeQuote;
|
||||
map[codes.escape] = buffers.escapeEscape;
|
||||
map[codes.b] = buffers.escapeB;
|
||||
map[codes.f] = buffers.escapeF;
|
||||
map[codes.n] = buffers.escapeN;
|
||||
map[codes.r] = buffers.escapeR;
|
||||
map[codes.t] = buffers.escapeT;
|
||||
|
||||
module.exports = function () {
|
||||
var stream = through(write, end);
|
||||
stream.push(buffers.quote);
|
||||
return stream;
|
||||
|
||||
function write (buf, enc, next) {
|
||||
var offset = 0;
|
||||
for (var i = 0; i < buf.length; i++) {
|
||||
var c = buf[i];
|
||||
var m = map[c];
|
||||
if (m) {
|
||||
var bufs = [ buf.slice(offset, i), m ];
|
||||
this.push(Buffer.concat(bufs));
|
||||
offset = i + 1;
|
||||
}
|
||||
else if (c < 32) {
|
||||
var bufs = [ buf.slice(offset, i), buffers[c] ];
|
||||
this.push(Buffer.concat(bufs));
|
||||
offset = i + 1;
|
||||
}
|
||||
else if (c === multiByteSeparatorCode) {
|
||||
var rawBuf = buf.slice(i, i + multiByteSeparatorLength);
|
||||
var escapeBuf = null;
|
||||
if (equals(rawBuf, multiByteBuffers.lineSeparator)) {
|
||||
escapeBuf = buffers.escapeLineSeparator;
|
||||
} else if (equals(rawBuf, multiByteBuffers.paragraphSeparator)) {
|
||||
escapeBuf = buffers.escapeParagraphSeparator;
|
||||
}
|
||||
if (escapeBuf) {
|
||||
var bufs = [ buf.slice(offset, i), escapeBuf ];
|
||||
this.push(Buffer.concat(bufs));
|
||||
offset = i + multiByteSeparatorLength;
|
||||
i += multiByteSeparatorOffset
|
||||
}
|
||||
}
|
||||
}
|
||||
if (offset === 0) this.push(buf)
|
||||
else this.push(buf.slice(offset));
|
||||
next();
|
||||
}
|
||||
function end (next) {
|
||||
this.push(buffers.quote);
|
||||
this.push(null);
|
||||
}
|
||||
};
|
||||
55
VISUALIZACION/node_modules/quote-stream/package.json
generated
vendored
Executable file
55
VISUALIZACION/node_modules/quote-stream/package.json
generated
vendored
Executable file
|
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
"name": "quote-stream",
|
||||
"version": "1.0.2",
|
||||
"description": "transform a stream into a quoted string",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
"quote-stream": "bin/cmd.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"buffer-equal": "0.0.1",
|
||||
"minimist": "^1.1.3",
|
||||
"through2": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"concat-stream": "~1.4.5",
|
||||
"tape": "^4.1.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tape test/*.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/substack/quote-stream.git"
|
||||
},
|
||||
"homepage": "https://github.com/substack/quote-stream",
|
||||
"keywords": [
|
||||
"quote",
|
||||
"transform",
|
||||
"stream"
|
||||
],
|
||||
"author": {
|
||||
"name": "James Halliday",
|
||||
"email": "mail@substack.net",
|
||||
"url": "http://substack.net"
|
||||
},
|
||||
"license": "MIT",
|
||||
"testling": {
|
||||
"files": "test/*.js",
|
||||
"browsers": [
|
||||
"ie/8..latest",
|
||||
"firefox/15",
|
||||
"firefox/latest",
|
||||
"firefox/nightly",
|
||||
"chrome/15",
|
||||
"chrome/latest",
|
||||
"chrome/canary",
|
||||
"opera/12..latest",
|
||||
"opera/next",
|
||||
"safari/5.1..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"android-browser/4.2..latest"
|
||||
]
|
||||
}
|
||||
}
|
||||
53
VISUALIZACION/node_modules/quote-stream/readme.markdown
generated
vendored
Executable file
53
VISUALIZACION/node_modules/quote-stream/readme.markdown
generated
vendored
Executable file
|
|
@ -0,0 +1,53 @@
|
|||
# quote-stream
|
||||
|
||||
transform a stream into a quoted string
|
||||
|
||||
[](https://ci.testling.com/substack/quote-stream)
|
||||
|
||||
[](http://travis-ci.org/substack/quote-stream)
|
||||
|
||||
# example
|
||||
|
||||
``` js
|
||||
var quote = require('quote-stream');
|
||||
process.stdin.pipe(quote()).pipe(process.stdout);
|
||||
```
|
||||
|
||||
output:
|
||||
|
||||
```
|
||||
$ echo beep boop | node example/stream.js
|
||||
"beep boop\n"
|
||||
```
|
||||
|
||||
# methods
|
||||
|
||||
``` js
|
||||
var quote = require('quote-stream')
|
||||
```
|
||||
|
||||
## var q = quote()
|
||||
|
||||
Return a transform stream `q` that wraps input in double quotes and adds escape
|
||||
characters to the chunks.
|
||||
|
||||
# usage
|
||||
|
||||
```
|
||||
usage: quote-stream
|
||||
|
||||
Transform stdin to a quoted string on stdout.
|
||||
|
||||
```
|
||||
|
||||
# install
|
||||
|
||||
With [npm](https://npmjs.org) do:
|
||||
|
||||
```
|
||||
npm install quote-stream
|
||||
```
|
||||
|
||||
# license
|
||||
|
||||
MIT
|
||||
13
VISUALIZACION/node_modules/quote-stream/test/simple.js
generated
vendored
Executable file
13
VISUALIZACION/node_modules/quote-stream/test/simple.js
generated
vendored
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
var quote = require('../');
|
||||
var concat = require('concat-stream');
|
||||
var test = require('tape');
|
||||
|
||||
test('simple', function (t) {
|
||||
t.plan(1);
|
||||
var q = quote();
|
||||
q.end('abc');
|
||||
|
||||
q.pipe(concat(function (body) {
|
||||
t.equal(body.toString('utf8'), '"abc"');
|
||||
}));
|
||||
});
|
||||
23
VISUALIZACION/node_modules/quote-stream/test/unicode_separators.js
generated
vendored
Executable file
23
VISUALIZACION/node_modules/quote-stream/test/unicode_separators.js
generated
vendored
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
var quote = require('../');
|
||||
var concat = require('concat-stream');
|
||||
var test = require('tape');
|
||||
|
||||
test('js string unicode separators', function (t) {
|
||||
t.plan(1);
|
||||
var q = quote();
|
||||
q.end('\u2027beep\u2028ima\u2029jeep\u2030');
|
||||
|
||||
q.pipe(concat(function (body) {
|
||||
t.equal(body.toString('utf8'), '"\u2027beep\\u2028ima\\u2029jeep\u2030"');
|
||||
}));
|
||||
});
|
||||
|
||||
test('utf8 separators', function (t) {
|
||||
t.plan(1);
|
||||
var q = quote();
|
||||
q.end(Buffer('beep\u2028ima\u2029jeep', 'utf8'));
|
||||
|
||||
q.pipe(concat(function (body) {
|
||||
t.equal(body.toString('utf8'), '"beep\\u2028ima\\u2029jeep"');
|
||||
}));
|
||||
});
|
||||
13
VISUALIZACION/node_modules/quote-stream/test/whitespace.js
generated
vendored
Executable file
13
VISUALIZACION/node_modules/quote-stream/test/whitespace.js
generated
vendored
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
var quote = require('../');
|
||||
var concat = require('concat-stream');
|
||||
var test = require('tape');
|
||||
|
||||
test('whitespace', function (t) {
|
||||
t.plan(1);
|
||||
var q = quote();
|
||||
q.end('abc\ndef\tghi\r\n');
|
||||
|
||||
q.pipe(concat(function (body) {
|
||||
t.equal(body.toString('utf8'), '"abc\\ndef\\tghi\\r\\n"');
|
||||
}));
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue