{ "_id": "ee-first", "_rev": "22-990712b104a4beb0b4974a5d1607ec96", "name": "ee-first", "description": "return the first event in a set of ee/event pairs", "dist-tags": { "latest": "1.1.1" }, "versions": { "1.0.0": { "name": "ee-first", "description": "return the first event in a set of ee/event pairs", "version": "1.0.0", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", "url": "http://jongleberry.com" }, "license": "MIT", "repository": { "type": "git", "url": "git://github.com/jonathanong/ee-first" }, "devDependencies": { "mocha": "1" }, "scripts": { "test": "mocha --reporter spec" }, "bugs": { "url": "https://github.com/jonathanong/ee-first/issues" }, "homepage": "https://github.com/jonathanong/ee-first", "_id": "ee-first@1.0.0", "_shasum": "f06454b54ed5921b51011c6b2f45e2f383ca6ea2", "_from": ".", "_npmVersion": "1.4.9", "_npmUser": { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" }, "maintainers": [ { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" } ], "dist": { "shasum": "f06454b54ed5921b51011c6b2f45e2f383ca6ea2", "tarball": "https://registry.npmjs.org/ee-first/-/ee-first-1.0.0.tgz" }, "directories": {} }, "1.0.1": { "name": "ee-first", "description": "return the first event in a set of ee/event pairs", "version": "1.0.1", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", "url": "http://jongleberry.com" }, "license": "MIT", "repository": { "type": "git", "url": "git://github.com/jonathanong/ee-first" }, "dependencies": { "sliced": "0" }, "devDependencies": { "mocha": "1" }, "scripts": { "test": "mocha --reporter spec" }, "bugs": { "url": "https://github.com/jonathanong/ee-first/issues" }, "homepage": "https://github.com/jonathanong/ee-first", "_id": "ee-first@1.0.1", "_shasum": "8d5e4fdba0f4a7cb8e790731cd275f938ee42f59", "_from": ".", "_npmVersion": "1.4.9", "_npmUser": { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" }, "maintainers": [ { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" } ], "dist": { "shasum": "8d5e4fdba0f4a7cb8e790731cd275f938ee42f59", "tarball": "https://registry.npmjs.org/ee-first/-/ee-first-1.0.1.tgz" }, "directories": {} }, "1.0.2": { "name": "ee-first", "description": "return the first event in a set of ee/event pairs", "version": "1.0.2", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", "url": "http://jongleberry.com" }, "license": "MIT", "repository": { "type": "git", "url": "git://github.com/jonathanong/ee-first" }, "devDependencies": { "mocha": "1" }, "scripts": { "test": "mocha --reporter spec" }, "bugs": { "url": "https://github.com/jonathanong/ee-first/issues" }, "homepage": "https://github.com/jonathanong/ee-first", "_id": "ee-first@1.0.2", "_shasum": "775dd7c8ed52233f2339563ae4d33c9a9cb2be3c", "_from": ".", "_npmVersion": "1.4.9", "_npmUser": { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" }, "maintainers": [ { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" }, { "name": "dougwilson", "email": "doug@somethingdoug.com" } ], "dist": { "shasum": "775dd7c8ed52233f2339563ae4d33c9a9cb2be3c", "tarball": "https://registry.npmjs.org/ee-first/-/ee-first-1.0.2.tgz" }, "directories": {} }, "1.0.3": { "name": "ee-first", "description": "return the first event in a set of ee/event pairs", "version": "1.0.3", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", "url": "http://jongleberry.com" }, "license": "MIT", "repository": { "type": "git", "url": "git://github.com/jonathanong/ee-first" }, "devDependencies": { "mocha": "1" }, "scripts": { "test": "mocha --reporter spec" }, "bugs": { "url": "https://github.com/jonathanong/ee-first/issues" }, "homepage": "https://github.com/jonathanong/ee-first", "_id": "ee-first@1.0.3", "_shasum": "6c98c4089abecb5a7b85c1ac449aa603d3b3dabe", "_from": ".", "_npmVersion": "1.4.9", "_npmUser": { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" }, "maintainers": [ { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" }, { "name": "dougwilson", "email": "doug@somethingdoug.com" } ], "dist": { "shasum": "6c98c4089abecb5a7b85c1ac449aa603d3b3dabe", "tarball": "https://registry.npmjs.org/ee-first/-/ee-first-1.0.3.tgz" }, "directories": {} }, "1.0.4": { "name": "ee-first", "description": "return the first event in a set of ee/event pairs", "version": "1.0.4", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", "url": "http://jongleberry.com" }, "contributors": [ { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" } ], "license": "MIT", "repository": { "type": "git", "url": "https://github.com/jonathanong/ee-first" }, "devDependencies": { "istanbul": "0.3.0", "mocha": "1" }, "files": [ "index.js" ], "scripts": { "test": "mocha --reporter spec --bail --check-leaks test/", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" }, "gitHead": "fbd53b0166f23d7712d551c4dd01673f87a74e88", "bugs": { "url": "https://github.com/jonathanong/ee-first/issues" }, "homepage": "https://github.com/jonathanong/ee-first", "_id": "ee-first@1.0.4", "_shasum": "44dbff0250fe667e8a042ec445afd1a9c4a1aeb2", "_from": ".", "_npmVersion": "1.4.21", "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" }, "maintainers": [ { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" }, { "name": "dougwilson", "email": "doug@somethingdoug.com" } ], "dist": { "shasum": "44dbff0250fe667e8a042ec445afd1a9c4a1aeb2", "tarball": "https://registry.npmjs.org/ee-first/-/ee-first-1.0.4.tgz" }, "directories": {} }, "1.0.5": { "name": "ee-first", "description": "return the first event in a set of ee/event pairs", "version": "1.0.5", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", "url": "http://jongleberry.com" }, "contributors": [ { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" } ], "license": "MIT", "repository": { "type": "git", "url": "https://github.com/jonathanong/ee-first" }, "devDependencies": { "istanbul": "0.3.0", "mocha": "1" }, "files": [ "index.js", "LICENSE" ], "scripts": { "test": "mocha --reporter spec --bail --check-leaks test/", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" }, "gitHead": "c9d9a6881863c0d2fcc2e4ac99a170088c205304", "bugs": { "url": "https://github.com/jonathanong/ee-first/issues" }, "homepage": "https://github.com/jonathanong/ee-first", "_id": "ee-first@1.0.5", "_shasum": "8c9b212898d8cd9f1a9436650ce7be202c9e9ff0", "_from": ".", "_npmVersion": "1.4.21", "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" }, "maintainers": [ { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" }, { "name": "dougwilson", "email": "doug@somethingdoug.com" } ], "dist": { "shasum": "8c9b212898d8cd9f1a9436650ce7be202c9e9ff0", "tarball": "https://registry.npmjs.org/ee-first/-/ee-first-1.0.5.tgz" }, "directories": {} }, "1.1.0": { "name": "ee-first", "description": "return the first event in a set of ee/event pairs", "version": "1.1.0", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", "url": "http://jongleberry.com" }, "contributors": [ { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" } ], "license": "MIT", "repository": { "type": "git", "url": "https://github.com/jonathanong/ee-first" }, "devDependencies": { "istanbul": "0.3.2", "mocha": "1" }, "files": [ "index.js", "LICENSE" ], "scripts": { "test": "mocha --reporter spec --bail --check-leaks test/", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" }, "gitHead": "a6412004da4745941af2fc98ec30c8da570da7ea", "bugs": { "url": "https://github.com/jonathanong/ee-first/issues" }, "homepage": "https://github.com/jonathanong/ee-first", "_id": "ee-first@1.1.0", "_shasum": "6a0d7c6221e490feefd92ec3f441c9ce8cd097f4", "_from": ".", "_npmVersion": "1.4.21", "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" }, "maintainers": [ { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" }, { "name": "dougwilson", "email": "doug@somethingdoug.com" } ], "dist": { "shasum": "6a0d7c6221e490feefd92ec3f441c9ce8cd097f4", "tarball": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.0.tgz" }, "directories": {} }, "1.1.1": { "name": "ee-first", "description": "return the first event in a set of ee/event pairs", "version": "1.1.1", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", "url": "http://jongleberry.com" }, "contributors": [ { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" } ], "license": "MIT", "repository": { "type": "git", "url": "https://github.com/jonathanong/ee-first" }, "devDependencies": { "istanbul": "0.3.9", "mocha": "2.2.5" }, "files": [ "index.js", "LICENSE" ], "scripts": { "test": "mocha --reporter spec --bail --check-leaks test/", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" }, "gitHead": "512e0ce4cc3643f603708f965a97b61b1a9c0441", "bugs": { "url": "https://github.com/jonathanong/ee-first/issues" }, "homepage": "https://github.com/jonathanong/ee-first", "_id": "ee-first@1.1.1", "_shasum": "590c61156b0ae2f4f0255732a158b266bc56b21d", "_from": ".", "_npmVersion": "1.4.28", "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" }, "maintainers": [ { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" }, { "name": "dougwilson", "email": "doug@somethingdoug.com" } ], "dist": { "shasum": "590c61156b0ae2f4f0255732a158b266bc56b21d", "tarball": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz" }, "directories": {} } }, "readme": "# EE First\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n[![Gittip][gittip-image]][gittip-url]\n\nGet the first event in a set of event emitters and event pairs,\nthen clean up after itself.\n\n## Install\n\n```sh\n$ npm install ee-first\n```\n\n## API\n\n```js\nvar first = require('ee-first')\n```\n\n### first(arr, listener)\n\nInvoke `listener` on the first event from the list specified in `arr`. `arr` is\nan array of arrays, with each array in the format `[ee, ...event]`. `listener`\nwill be called only once, the first time any of the given events are emitted. If\n`error` is one of the listened events, then if that fires first, the `listener`\nwill be given the `err` argument.\n\nThe `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the\nfirst argument emitted from an `error` event, if applicable; `ee` is the event\nemitter that fired; `event` is the string event name that fired; and `args` is an\narray of the arguments that were emitted on the event.\n\n```js\nvar ee1 = new EventEmitter()\nvar ee2 = new EventEmitter()\n\nfirst([\n [ee1, 'close', 'end', 'error'],\n [ee2, 'error']\n], function (err, ee, event, args) {\n // listener invoked\n})\n```\n\n#### .cancel()\n\nThe group of listeners can be cancelled before being invoked and have all the event\nlisteners removed from the underlying event emitters.\n\n```js\nvar thunk = first([\n [ee1, 'close', 'end', 'error'],\n [ee2, 'error']\n], function (err, ee, event, args) {\n // listener invoked\n})\n\n// cancel and clean up\nthunk.cancel()\n```\n\n[npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/ee-first\n[github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square\n[github-url]: https://github.com/jonathanong/ee-first/tags\n[travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square\n[travis-url]: https://travis-ci.org/jonathanong/ee-first\n[coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master\n[license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square\n[license-url]: LICENSE.md\n[downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/ee-first\n[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square\n[gittip-url]: https://www.gittip.com/jonathanong/\n", "maintainers": [ { "name": "dougwilson", "email": "doug@somethingdoug.com" }, { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" } ], "time": { "modified": "2016-11-01T17:18:18.975Z", "created": "2014-06-11T01:31:59.902Z", "1.0.0": "2014-06-11T01:31:59.902Z", "1.0.1": "2014-06-11T01:50:57.486Z", "1.0.2": "2014-06-11T03:50:16.688Z", "1.0.3": "2014-06-11T04:22:46.000Z", "1.0.4": "2014-08-15T20:04:59.878Z", "1.0.5": "2014-08-15T21:20:58.889Z", "1.1.0": "2014-10-22T05:53:29.380Z", "1.1.1": "2015-05-25T19:18:28.732Z" }, "homepage": "https://github.com/jonathanong/ee-first", "repository": { "type": "git", "url": "https://github.com/jonathanong/ee-first" }, "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", "url": "http://jongleberry.com" }, "bugs": { "url": "https://github.com/jonathanong/ee-first/issues" }, "license": "MIT", "readmeFilename": "README.md", "contributors": [ { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" } ], "users": { "zhangyaochun": true, "bapinney": true, "monjer": true, "mojaray2k": true }, "_attachments": {} }