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.

readme.md 571B

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