You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Sindre Sorhus 3847c3da6c 5.0.0 9 years ago
.editorconfig various tweaks 10 years ago
.gitattributes init 11 years ago
.gitignore init 11 years ago
.travis.yml convert to Promise API 9 years ago
index.js convert to Promise API 9 years ago
license various tweaks 10 years ago
package.json 5.0.0 9 years ago
readme.md improve description 9 years ago
test-buffer.js `buffer-equal` → `buffer-equals` 9 years ago
test-real.js convert to Promise API 9 years ago
test.js convert to Promise API 9 years ago

readme.md

get-stdin Build Status

Get stdin as a string or buffer

Install

$ npm install --save get-stdin

Usage

// example.js
const stdin = require('get-stdin');

stdin.then(x => {
	console.log(x);
	//=> 'unicorns'
});
$ echo unicorns | node example.js
unicorns

API

stdin()

Get stdin as a string.

Returns a promise.

stdin.buffer()

Get stdin as a buffer.

Returns a promise.

License

MIT © Sindre Sorhus