Initial commit for OpenECOMP SDN-C OA&M
[sdnc/oam.git] / dgbuilder / dgeflows / node_modules / morgan / node_modules / on-finished / node_modules / ee-first / README.md
diff --git a/dgbuilder/dgeflows/node_modules/morgan/node_modules/on-finished/node_modules/ee-first/README.md b/dgbuilder/dgeflows/node_modules/morgan/node_modules/on-finished/node_modules/ee-first/README.md
new file mode 100644 (file)
index 0000000..bb16aab
--- /dev/null
@@ -0,0 +1,80 @@
+# EE First\r
+\r
+[![NPM version][npm-image]][npm-url]\r
+[![Build status][travis-image]][travis-url]\r
+[![Test coverage][coveralls-image]][coveralls-url]\r
+[![License][license-image]][license-url]\r
+[![Downloads][downloads-image]][downloads-url]\r
+[![Gittip][gittip-image]][gittip-url]\r
+\r
+Get the first event in a set of event emitters and event pairs,\r
+then clean up after itself.\r
+\r
+## Install\r
+\r
+```sh\r
+$ npm install ee-first\r
+```\r
+\r
+## API\r
+\r
+```js\r
+var first = require('ee-first')\r
+```\r
+\r
+### first(arr, listener)\r
+\r
+Invoke `listener` on the first event from the list specified in `arr`. `arr` is\r
+an array of arrays, with each array in the format `[ee, ...event]`. `listener`\r
+will be called only once, the first time any of the given events are emitted. If\r
+`error` is one of the listened events, then if that fires first, the `listener`\r
+will be given the `err` argument.\r
+\r
+The `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the\r
+first argument emitted from an `error` event, if applicable; `ee` is the event\r
+emitter that fired; `event` is the string event name that fired; and `args` is an\r
+array of the arguments that were emitted on the event.\r
+\r
+```js\r
+var ee1 = new EventEmitter()\r
+var ee2 = new EventEmitter()\r
+\r
+first([\r
+  [ee1, 'close', 'end', 'error'],\r
+  [ee2, 'error']\r
+], function (err, ee, event, args) {\r
+  // listener invoked\r
+})\r
+```\r
+\r
+#### .cancel()\r
+\r
+The group of listeners can be cancelled before being invoked and have all the event\r
+listeners removed from the underlying event emitters.\r
+\r
+```js\r
+var thunk = first([\r
+  [ee1, 'close', 'end', 'error'],\r
+  [ee2, 'error']\r
+], function (err, ee, event, args) {\r
+  // listener invoked\r
+})\r
+\r
+// cancel and clean up\r
+thunk.cancel()\r
+```\r
+\r
+[npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square\r
+[npm-url]: https://npmjs.org/package/ee-first\r
+[github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square\r
+[github-url]: https://github.com/jonathanong/ee-first/tags\r
+[travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square\r
+[travis-url]: https://travis-ci.org/jonathanong/ee-first\r
+[coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square\r
+[coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master\r
+[license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square\r
+[license-url]: LICENSE.md\r
+[downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square\r
+[downloads-url]: https://npmjs.org/package/ee-first\r
+[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square\r
+[gittip-url]: https://www.gittip.com/jonathanong/\r