Socket
Socket
Sign inDemoInstall

get-stdin

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-stdin - npm Package Compare versions

Comparing version 5.0.0 to 5.0.1

9

package.json
{
"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)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc