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.1 to 6.0.0

30

index.js
'use strict';
var stdin = process.stdin;
const stdin = process.stdin;
module.exports = function () {
var ret = '';
module.exports = () => {
let ret = '';
return new Promise(function (resolve) {
return new Promise(resolve => {
if (stdin.isTTY) {

@@ -15,4 +15,4 @@ resolve(ret);

stdin.on('readable', function () {
var chunk;
stdin.on('readable', () => {
let chunk;

@@ -24,3 +24,3 @@ while ((chunk = stdin.read())) {

stdin.on('end', function () {
stdin.on('end', () => {
resolve(ret);

@@ -31,14 +31,14 @@ });

module.exports.buffer = function () {
var ret = [];
var len = 0;
module.exports.buffer = () => {
const ret = [];
let len = 0;
return new Promise(function (resolve) {
return new Promise(resolve => {
if (stdin.isTTY) {
resolve(new Buffer(''));
resolve(Buffer.concat([]));
return;
}
stdin.on('readable', function () {
var chunk;
stdin.on('readable', () => {
let chunk;

@@ -51,3 +51,3 @@ while ((chunk = stdin.read())) {

stdin.on('end', function () {
stdin.on('end', () => {
resolve(Buffer.concat(ret, len));

@@ -54,0 +54,0 @@ });

{
"name": "get-stdin",
"version": "5.0.1",
"description": "Get stdin as a string or buffer",
"license": "MIT",
"repository": "sindresorhus/get-stdin",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=0.12.0"
},
"scripts": {
"test": "xo && ava test.js && echo unicorns | ava test-real.js"
},
"files": [
"index.js"
],
"keywords": [
"std",
"stdin",
"stdio",
"concat",
"buffer",
"stream",
"process",
"read"
],
"devDependencies": {
"ava": "*",
"buffer-equals": "^1.0.3",
"xo": "*"
},
"xo": {
"ignores": [
"test.js"
]
}
"name": "get-stdin",
"version": "6.0.0",
"description": "Get stdin as a string or buffer",
"license": "MIT",
"repository": "sindresorhus/get-stdin",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava test.js test-buffer.js && echo unicorns | node test-real.js"
},
"files": [
"index.js"
],
"keywords": [
"std",
"stdin",
"stdio",
"concat",
"buffer",
"stream",
"process",
"read"
],
"devDependencies": {
"ava": "*",
"xo": "*"
}
}

@@ -9,3 +9,3 @@ # get-stdin [![Build Status](https://travis-ci.org/sindresorhus/get-stdin.svg?branch=master)](https://travis-ci.org/sindresorhus/get-stdin)

```
$ npm install --save get-stdin
$ npm install get-stdin
```

@@ -38,3 +38,3 @@

Get `stdin` as a string.
Get `stdin` as a `string`.

@@ -45,3 +45,3 @@ In a TTY context, a promise that resolves to an empty string is returned.

Get `stdin` as a buffer.
Get `stdin` as a `Buffer`.

@@ -58,2 +58,2 @@ In a TTY context, a promise that resolves to an empty buffer is returned.

MIT © [Sindre Sorhus](http://sindresorhus.com)
MIT © [Sindre Sorhus](https://sindresorhus.com)

Sorry, the diff of this file is not supported yet

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