UNPKG

472 BMarkdownView Raw
1# get-stdin [![Build Status](https://travis-ci.org/sindresorhus/get-stdin.svg?branch=master)](https://travis-ci.org/sindresorhus/get-stdin)
2
3> Easier stdin
4
5
6## Install
7
8```sh
9$ npm install --save get-stdin
10```
11
12
13## Usage
14
15```js
16// example.js
17var stdin = require('get-stdin');
18
19stdin(function (data) {
20 console.log(data.toString());
21 //=> unicorns
22});
23```
24
25```sh
26$ echo unicorns | node example.js
27unicorns
28```
29
30
31## License
32
33MIT © [Sindre Sorhus](http://sindresorhus.com)