Pushing changes
This commit is contained in:
49
node_modules/get-stdin/index.js
generated
vendored
Normal file
49
node_modules/get-stdin/index.js
generated
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (cb) {
|
||||
var stdin = process.stdin;
|
||||
var ret = '';
|
||||
|
||||
if (stdin.isTTY) {
|
||||
setImmediate(cb, '');
|
||||
return;
|
||||
}
|
||||
|
||||
stdin.setEncoding('utf8');
|
||||
|
||||
stdin.on('readable', function () {
|
||||
var chunk;
|
||||
|
||||
while (chunk = stdin.read()) {
|
||||
ret += chunk;
|
||||
}
|
||||
});
|
||||
|
||||
stdin.on('end', function () {
|
||||
cb(ret);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.buffer = function (cb) {
|
||||
var stdin = process.stdin;
|
||||
var ret = [];
|
||||
var len = 0;
|
||||
|
||||
if (stdin.isTTY) {
|
||||
setImmediate(cb, new Buffer(''));
|
||||
return;
|
||||
}
|
||||
|
||||
stdin.on('readable', function () {
|
||||
var chunk;
|
||||
|
||||
while (chunk = stdin.read()) {
|
||||
ret.push(chunk);
|
||||
len += chunk.length;
|
||||
}
|
||||
});
|
||||
|
||||
stdin.on('end', function () {
|
||||
cb(Buffer.concat(ret, len));
|
||||
});
|
||||
};
|
99
node_modules/get-stdin/package.json
generated
vendored
Normal file
99
node_modules/get-stdin/package.json
generated
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"raw": "get-stdin@^4.0.1",
|
||||
"scope": null,
|
||||
"escapedName": "get-stdin",
|
||||
"name": "get-stdin",
|
||||
"rawSpec": "^4.0.1",
|
||||
"spec": ">=4.0.1 <5.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"/home/burchettm/statsbot/node_modules/dateformat"
|
||||
]
|
||||
],
|
||||
"_from": "get-stdin@>=4.0.1 <5.0.0",
|
||||
"_id": "get-stdin@4.0.1",
|
||||
"_inCache": true,
|
||||
"_location": "/get-stdin",
|
||||
"_npmUser": {
|
||||
"name": "sindresorhus",
|
||||
"email": "sindresorhus@gmail.com"
|
||||
},
|
||||
"_npmVersion": "1.4.28",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "get-stdin@^4.0.1",
|
||||
"scope": null,
|
||||
"escapedName": "get-stdin",
|
||||
"name": "get-stdin",
|
||||
"rawSpec": "^4.0.1",
|
||||
"spec": ">=4.0.1 <5.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/dateformat",
|
||||
"/strip-indent"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",
|
||||
"_shasum": "b968c6b0a04384324902e8bf1a5df32579a450fe",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "get-stdin@^4.0.1",
|
||||
"_where": "/home/burchettm/statsbot/node_modules/dateformat",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "http://sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/get-stdin/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Easier stdin",
|
||||
"devDependencies": {
|
||||
"ava": "0.0.4",
|
||||
"buffer-equal": "0.0.1"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "b968c6b0a04384324902e8bf1a5df32579a450fe",
|
||||
"tarball": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "65c744975229b25d6cc5c7546f49b6ad9099553f",
|
||||
"homepage": "https://github.com/sindresorhus/get-stdin",
|
||||
"keywords": [
|
||||
"std",
|
||||
"stdin",
|
||||
"stdio",
|
||||
"concat",
|
||||
"buffer",
|
||||
"stream",
|
||||
"process",
|
||||
"stream"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "sindresorhus",
|
||||
"email": "sindresorhus@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "get-stdin",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/get-stdin.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test.js && node test-buffer.js && echo unicorns | node test-real.js"
|
||||
},
|
||||
"version": "4.0.1"
|
||||
}
|
44
node_modules/get-stdin/readme.md
generated
vendored
Normal file
44
node_modules/get-stdin/readme.md
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
# get-stdin [](https://travis-ci.org/sindresorhus/get-stdin)
|
||||
|
||||
> Easier stdin
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
$ npm install --save get-stdin
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// example.js
|
||||
var stdin = require('get-stdin');
|
||||
|
||||
stdin(function (data) {
|
||||
console.log(data);
|
||||
//=> unicorns
|
||||
});
|
||||
```
|
||||
|
||||
```sh
|
||||
$ echo unicorns | node example.js
|
||||
unicorns
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### stdin(callback)
|
||||
|
||||
Get `stdin` as a string.
|
||||
|
||||
### stdin.buffer(callback)
|
||||
|
||||
Get `stdin` as a buffer.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
Reference in New Issue
Block a user