Initial commit
[yaffs-website] / node_modules / get-stdin / readme.md
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
17 var stdin = require('get-stdin');
18
19 stdin(function (data) {
20         console.log(data);
21         //=> unicorns
22 });
23 ```
24
25 ```sh
26 $ echo unicorns | node example.js
27 unicorns
28 ```
29
30
31 ## API
32
33 ### stdin(callback)
34
35 Get `stdin` as a string.
36
37 ### stdin.buffer(callback)
38
39 Get `stdin` as a buffer.
40
41
42 ## License
43
44 MIT © [Sindre Sorhus](http://sindresorhus.com)