Comparing version 5.0.0 to 5.0.1
{ | ||
"name": "get-stdin", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "Get stdin as a string or buffer", | ||
@@ -16,3 +16,3 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "xo && ava test.js test-buffer.js && echo unicorns | ava test-real.js" | ||
"test": "xo && ava test.js && echo unicorns | ava test-real.js" | ||
}, | ||
@@ -36,3 +36,8 @@ "files": [ | ||
"xo": "*" | ||
}, | ||
"xo": { | ||
"ignores": [ | ||
"test.js" | ||
] | ||
} | ||
} |
# get-stdin [![Build Status](https://travis-ci.org/sindresorhus/get-stdin.svg?branch=master)](https://travis-ci.org/sindresorhus/get-stdin) | ||
> Get stdin as a string or buffer | ||
> Get [stdin](https://nodejs.org/api/process.html#process_process_stdin) as a string or buffer | ||
@@ -17,6 +17,6 @@ | ||
// example.js | ||
const stdin = require('get-stdin'); | ||
const getStdin = require('get-stdin'); | ||
stdin.then(x => { | ||
console.log(x); | ||
getStdin().then(str => { | ||
console.log(str); | ||
//=> 'unicorns' | ||
@@ -34,17 +34,24 @@ }); | ||
### stdin() | ||
Both methods returns a promise that is resolved when the `end` event fires on the `stdin` stream, indicating that there is no more data to be read. | ||
### getStdin() | ||
Get `stdin` as a string. | ||
Returns a promise. | ||
In a TTY context, a promise that resolves to an empty string is returned. | ||
### stdin.buffer() | ||
### getStdin.buffer() | ||
Get `stdin` as a buffer. | ||
Returns a promise. | ||
In a TTY context, a promise that resolves to an empty buffer is returned. | ||
## Related | ||
- [get-stream](https://github.com/sindresorhus/get-stream) - Get a stream as a string or buffer | ||
## License | ||
MIT © [Sindre Sorhus](http://sindresorhus.com) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3683
56