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
|
9 years ago | |
---|---|---|
.editorconfig | 10 years ago | |
.gitattributes | 11 years ago | |
.gitignore | 11 years ago | |
.travis.yml | 9 years ago | |
index.js | 9 years ago | |
license | 10 years ago | |
package.json | 9 years ago | |
readme.md | 9 years ago | |
test-buffer.js | 9 years ago | |
test-real.js | 9 years ago | |
test.js | 9 years ago |
readme.md
get-stdin
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