{"name":"inflight","version":"1.0.5","description":"Add callbacks to requests in flight to avoid async duplication","main":"inflight.js","files":["inflight.js"],"dependencies":{"once":"^1.3.0","wrappy":"1"},"devDependencies":{"tap":"^1.2.0"},"scripts":{"test":"tap test.js"},"repository":{"type":"git","url":"git+https://github.com/npm/inflight.git"},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"bugs":{"url":"https://github.com/isaacs/inflight/issues"},"homepage":"https://github.com/isaacs/inflight","license":"ISC","gitHead":"559e37b4f6327fca797fe8d7fe8ed6d9cae08821","_id":"inflight@1.0.5","_shasum":"db3204cd5a9de2e6cd890b85c6e2f66bcf4f620a","_from":".","_npmVersion":"3.9.1","_nodeVersion":"5.10.1","_npmUser":{"name":"zkat","email":"kat@sykosomatic.org"},"dist":{"shasum":"db3204cd5a9de2e6cd890b85c6e2f66bcf4f620a","tarball":"http://registry-npm.ywwl.com/inflight/download/inflight-1.0.5.tgz","integrity":"sha512-ZOr/ZZjWvVTQML+yBDtsvuVlC9zkWqmaZVZTWP7XdfMTmoO3qjIP26vjfDKDJ6zA9ZffGlnm6Ry5t965o+WUgA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD20TiDL6jN6/AQQqM70KVWlPn9Wij0jPTOpoScNOpfNgIgMhxPzqjK2N9SmQkfYweGc7upRJOMmplNLXj47w0HCPg="}],"size":1802,"noattachment":false,"key":"/inflight/-/inflight-1.0.5.tgz"},"maintainers":[{"name":"iarna","email":"me@re-becca.org"},{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"},{"name":"zkat","email":"kat@sykosomatic.org"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/inflight-1.0.5.tgz_1463529611443_0.00041943578980863094"},"directories":{},"deprecated":"This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.","readme":"# inflight\n\nAdd callbacks to requests in flight to avoid async duplication\n\n## USAGE\n\n```javascript\nvar inflight = require('inflight')\n\n// some request that does some stuff\nfunction req(key, callback) {\n  // key is any random string.  like a url or filename or whatever.\n  //\n  // will return either a falsey value, indicating that the\n  // request for this key is already in flight, or a new callback\n  // which when called will call all callbacks passed to inflightk\n  // with the same key\n  callback = inflight(key, callback)\n\n  // If we got a falsey value back, then there's already a req going\n  if (!callback) return\n\n  // this is where you'd fetch the url or whatever\n  // callback is also once()-ified, so it can safely be assigned\n  // to multiple events etc.  First call wins.\n  setTimeout(function() {\n    callback(null, key)\n  }, 100)\n}\n\n// only assigns a single setTimeout\n// when it dings, all cbs get called\nreq('foo', cb1)\nreq('foo', cb2)\nreq('foo', cb3)\nreq('foo', cb4)\n```\n","publish_time":1463529612031,"_cnpm_publish_time":1463529612031,"dist-tags":{"latest":"1.0.6"}}