demo___customer_pitch-c4152739-a50b-4b5b-9d4d-0561461666d9.zip-extract/_dependencies/npm/ee-first-1.1.1/README.md

Path
demo___customer_pitch-c4152739-a50b-4b5b-9d4d-0561461666d9.zip-extract/_dependencies/npm/ee-first-1.1.1/README.md
Status
scanned
Type
file
Name
README.md
Extension
.md
Programming language

      
    
Mime type
text/plain
File type
ASCII text
Tag

      
    
Rootfs path

      
    
Size
2617 (2.6 KB)
MD5
8591e9d47fb8574f4a99ac3de242b3cc
SHA1
7c611cdeb6b66df78adfb4b1a56fec087dce14b5
SHA256
4480e03d020436e665886a99120abb2ee7fb422850e1b53ccbdbdbd251414c23
SHA512

      
    
SHA1_git
cbd2478beffb7e4e612f99e8bff383255c21f253
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
README.md | 2.6 KB |

# EE First [![NPM version][npm-image]][npm-url] [![Build status][travis-image]][travis-url] [![Test coverage][coveralls-image]][coveralls-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] [![Gittip][gittip-image]][gittip-url] Get the first event in a set of event emitters and event pairs, then clean up after itself. ## Install ```sh $ npm install ee-first ``` ## API ```js var first = require('ee-first') ``` ### first(arr, listener) Invoke `listener` on the first event from the list specified in `arr`. `arr` is an array of arrays, with each array in the format `[ee, ...event]`. `listener` will be called only once, the first time any of the given events are emitted. If `error` is one of the listened events, then if that fires first, the `listener` will be given the `err` argument. The `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the first argument emitted from an `error` event, if applicable; `ee` is the event emitter that fired; `event` is the string event name that fired; and `args` is an array of the arguments that were emitted on the event. ```js var ee1 = new EventEmitter() var ee2 = new EventEmitter() first([ [ee1, 'close', 'end', 'error'], [ee2, 'error'] ], function (err, ee, event, args) { // listener invoked }) ``` #### .cancel() The group of listeners can be cancelled before being invoked and have all the event listeners removed from the underlying event emitters. ```js var thunk = first([ [ee1, 'close', 'end', 'error'], [ee2, 'error'] ], function (err, ee, event, args) { // listener invoked }) // cancel and clean up thunk.cancel() ``` [npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square [npm-url]: https://npmjs.org/package/ee-first [github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square [github-url]: https://github.com/jonathanong/ee-first/tags [travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square [travis-url]: https://travis-ci.org/jonathanong/ee-first [coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square [coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master [license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square [license-url]: LICENSE.md [downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square [downloads-url]: https://npmjs.org/package/ee-first [gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square [gittip-url]: https://www.gittip.com/jonathanong/
URL Start line End line
https://img.shields.io/npm/v/ee-first.svg?style=flat-square 67 67
https://npmjs.org/package/ee-first 68 68
http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square 69 69
https://github.com/jonathanong/ee-first/tags 70 70
https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square 71 71
https://travis-ci.org/jonathanong/ee-first 72 72
https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square 73 73
https://coveralls.io/r/jonathanong/ee-first?branch=master 74 74
http://img.shields.io/npm/l/ee-first.svg?style=flat-square 75 75
http://img.shields.io/npm/dm/ee-first.svg?style=flat-square 77 77
https://img.shields.io/gittip/jonathanong.svg?style=flat-square 79 79
https://www.gittip.com/jonathanong/ 80 80
Package URL License Primary language
pkg:npm/ee-first@1.1.1 mit JavaScript
pkg:npm/acme-demo-app@1.0.0 JavaScript