get-stdin

Get stdin as a string or buffer

get-stdin

Get stdin as a string or buffer

$ npm install --save get-stdin
// example.js 
const stdin = require('get-stdin');
 
stdin.then(=> {
    console.log(x);
    //=> 'unicorns' 
});
$ echo unicorns | node example.js
unicorns

Get stdin as a string.

Returns a promise.

Get stdin as a buffer.

Returns a promise.

MIT © Sindre Sorhus