{"_id":"@datadog/async-listener","_rev":"1-a8a17371092515ab171b2a33a0203549","name":"@datadog/async-listener","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@datadog/async-listener","version":"0.1.0","description":"Polyfill exporting trevnorris's 0.11+ asyncListener API.","author":{"name":"Forrest L Norvell","email":"ogd@aoaioxxysz.net"},"contributors":[{"name":"Tim Caswell","email":"tim@creationix.com"},{"name":"Forrest L Norvell","email":"ogd@aoaioxxysz.net"}],"main":"index.js","scripts":{"test":"tap test/*.tap.js"},"repository":{"type":"git","url":"git+https://github.com/DataDog/async-listener.git"},"keywords":["polyfill","shim","zesty","crazed","experimental"],"license":"BSD-2-Clause","bugs":{"url":"https://github.com/DataDog/async-listener/issues"},"engines":{"node":"<=0.11.8 || >0.11.10"},"dependencies":{"semver":"^5.3.0","shimmer":"^1.1.0"},"devDependencies":{"tap":"^0.7.1"},"gitHead":"21ec34b72cd2b6127a3e5520b9d2b691ffcbb852","homepage":"https://github.com/DataDog/async-listener#readme","_id":"@datadog/async-listener@0.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"datadog","email":"robot-npm-frontend@datadoghq.com"},"dist":{"integrity":"sha512-xZ24lAALJ7h6aqwMuSwM28vpILtBEuNhfSx2ggGOeol373iVUwsj7bWUHBLDMDRVVyl5Gg5VHuY1Ma0W0DovEg==","shasum":"aed1087b8267b7b93912a6d2136e49800ed0fa1e","tarball":"https://registry.npmjs.org/@datadog/async-listener/-/async-listener-0.1.0.tgz","fileCount":6,"unpackedSize":33674,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7ryNCRA9TVsSAnZWagAA1CsQAIVEBCgfgM/IjWahQg1e\nLORe5VkwLcmzOY80sD1ilcDYl/Y43WFds/qmksPF37tebGc9M0UwQDKb0+XQ\nA/IEGcGxl0VscsXpagnoZea7K1bGpG/RlxJJTiZ2Rpk6DkL5aopvsZ487mLy\nIFnMMJjMSJIoO9ysNsA/hbv2gbID/Xc1uRiZKIAtuQKG1MfvtgnW+wGKPIGV\n6ls4xnV/xw1c+AxNY7dwLCI2yfTHLv1Qo0m74gH+h0BREqsgYxh6Fr96iNXd\n4zS0dY5JzHe4S3cfOqdVf9k6NhrZbXD6Yum/6JnrTSepR3h8SJY8NEi3T42d\nY8ZoHIxLLgnqO0bU636hn7JXnU1UMjus/YNvM0u6TRNff8q0tZI5KvXrSui3\n1Rr54//yP5Di4Twpnv7kM3KT2zu+vSr2I4w3OVc8UFXlXnF+qlv+94aoNziq\nvRyNQHgMqaWw5exidpGSG4cNGcrJBiy7wxyh/RSN59fsiFL+sPLeN3NvS5H+\nI+FHUkovWXq5QN9drynKYdbfV8eRzksNiQ8kORr12/rfgEjD7GvBNXnNNzqi\ncA+P5sx3M/v+1EALks82Dm6FZYMd8PNB+PjAFidvYOI8aMl7+Xp2cVIa36pq\nFbl+RAvaL09/4WDln34TkWWvf7ojRMgKJ/Yg3dJfl+YTxmbbhzeU8XRS2pFm\n0XC8\r\n=681k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgXWjdCVKb+ldfpFYrHYNQmzvXQVIgP6ZRpJoFZo9GWAIgb0KgO6w+ooPmWZd9f1+5L3EBZ4U3rKuKQbEL/CKlagU="}]},"maintainers":[{"name":"datadog","email":"robot-npm-frontend@datadoghq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-listener_0.1.0_1559149708809_0.6346169192819686"},"_hasShrinkwrap":false}},"time":{"created":"2019-05-29T17:08:28.771Z","0.1.0":"2019-05-29T17:08:29.030Z","modified":"2022-04-05T02:53:36.477Z"},"maintainers":[{"name":"datadog","email":"robot-npm-frontend@datadoghq.com"}],"description":"Polyfill exporting trevnorris's 0.11+ asyncListener API.","homepage":"https://github.com/DataDog/async-listener#readme","keywords":["polyfill","shim","zesty","crazed","experimental"],"repository":{"type":"git","url":"git+https://github.com/DataDog/async-listener.git"},"contributors":[{"name":"Tim Caswell","email":"tim@creationix.com"},{"name":"Forrest L Norvell","email":"ogd@aoaioxxysz.net"}],"author":{"name":"Forrest L Norvell","email":"ogd@aoaioxxysz.net"},"bugs":{"url":"https://github.com/DataDog/async-listener/issues"},"license":"BSD-2-Clause","readme":"[![NPM](https://nodei.co/npm/@datadog/async-listener.png?downloads=true&stars=true)](https://nodei.co/npm/@datadog/async-listener/)\n\n[![Build status](https://travis-ci.org/DataDog/async-listener.svg?branch=datadog)](https://travis-ci.org/DataDog/async-listener)\n\n*This fork of [async-listener](https://github.com/othiym23/async-listener) makes\nthe following changes:*\n\n* *For promises, `.then()` callbacks are bound to the context in which `.then()`\nwas called instead of the context in which `resolve()` was called.*\n* *The API below is exported by the library instead of being attached directly\nto `process`. This avoids conflicts with the existing implementation. However,\nit means this fork cannot be used as a polyfill.*\n\n# process.addAsyncListener polyfill\n\nThis is an implementation of Trevor Norris's\nprocess.{addAsyncListener,removeAsyncListener} API for adding behavior to async\ncalls. You can see his implementation (currently a work in progress) on\n[Node.js core pull request #6011](https://github.com/joyent/node/pull/6011).\nThis polyfill / shim is intended for use in versions of Node prior to whatever\nversion of Node in which Trevor's changes finally land (anticipated at the time\nof this writing as 0.11.7).\n\nHere's his documentation of the intended API, which will probably get cleaned up\nhere later:\n\n## createAsyncListener(callbacks[, initialStorage])\n\n* `callbacks` {Object}\n* `initialStorage` {Value}\n\nReturns a constructed `AsyncListener` object. Which can then be passed to\n`process.addAsyncListener()` and `process.removeAsyncListener()`. Each\nfunction parameter is as follows:\n\n1. `callbacks`: An `Object` which may contain four optional fields:\n   * `create`: A `function (storage)` that is called when an asynchronous event\n     is queued. Recives the `storage` attached to the listener. `storage` can be\n     created by passing an `initialStorage` argument during construction, or by\n     returning a `Value` from `create` which will be attached to the listener\n     and overwrite the `initialStorage`.\n   * `before`: A `function (context, storage)` that is called immediately\n     before the asynchronous callback is about to run. It will be passed both\n     the `context` (i.e. `this`) of the calling function and the `storage`.\n   * `after`: A `function (context, storage)` called immediately after the\n     asynchronous event's callback is run. Note that if the event's callback\n     throws during execution this will not be called.\n   * `error`: A `function (storage, error)` called if the event's callback\n     threw. If `error` returns `true` then Node will assume the error has been\n     properly handled and resume execution normally.\n1. `initialStorage`: A `Value` (i.e. anything) that will be, by default,\n   attached to all new event instances. This will be overwritten if a `Value`\n   is returned by `create()`.\n\n\n## addAsyncListener(callbacks[, initialStorage])\n## addAsyncListener(asyncListener)\n\nReturns a constructed `AsyncListener` object and immediately adds it to the\nlistening queue.\n\n## removeAsyncListener(asyncListener)\n\nRemoves the `asyncListener` from the listening queue.\n","readmeFilename":"README.md"}