租房小程序前端代码
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.

46 lines
1.4 KiB

3 months ago
  1. end-or-error
  2. =======
  3. [![NPM version][npm-image]][npm-url]
  4. [![build status][travis-image]][travis-url]
  5. [![Test coverage][coveralls-image]][coveralls-url]
  6. [![Gittip][gittip-image]][gittip-url]
  7. [![David deps][david-image]][david-url]
  8. [![npm download][download-image]][download-url]
  9. [npm-image]: https://img.shields.io/npm/v/end-or-error.svg?style=flat-square
  10. [npm-url]: https://npmjs.org/package/end-or-error
  11. [travis-image]: https://img.shields.io/travis/stream-utils/end-or-error.svg?style=flat-square
  12. [travis-url]: https://travis-ci.org/stream-utils/end-or-error
  13. [coveralls-image]: https://img.shields.io/coveralls/stream-utils/end-or-error.svg?style=flat-square
  14. [coveralls-url]: https://coveralls.io/r/stream-utils/end-or-error?branch=master
  15. [gittip-image]: https://img.shields.io/gittip/fengmk2.svg?style=flat-square
  16. [gittip-url]: https://www.gittip.com/fengmk2/
  17. [david-image]: https://img.shields.io/david/stream-utils/end-or-error.svg?style=flat-square
  18. [david-url]: https://david-dm.org/stream-utils/end-or-error
  19. [download-image]: https://img.shields.io/npm/dm/end-or-error.svg?style=flat-square
  20. [download-url]: https://npmjs.org/package/end-or-error
  21. Listen readable stream `end` or `error` event once.
  22. ## Install
  23. ```bash
  24. $ npm i end-or-error
  25. ```
  26. ## Usage
  27. ```js
  28. var eoe = require('end-or-error');
  29. var stream = createReadStreamSomeHow();
  30. eoe(stream, function (err) {
  31. // err => stream emitted "error" event
  32. });
  33. ```
  34. ## License
  35. [MIT](LICENSE)