{"name":"debounceify","version":"1.1.0","description":"Tiny async debouncer","main":"index.js","dependencies":{},"devDependencies":{"standard":"^16.0.3","tape":"^5.1.1"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/debounceify.git"},"scripts":{"test":"standard && tape test.js"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/debounceify/issues"},"homepage":"https://github.com/mafintosh/debounceify","_id":"debounceify@1.1.0","gitHead":"97ba02c8ef8e89176495dd99b1cb952ab100c761","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-eKuHDVfJVg+u/0nPy8P+fhnLgbyuTgVxuCRrS/R7EpDSMMkBDgSes41MJtSAY1F1hcqfHz3Zy/qpqHHIp/EhdA==","shasum":"393505192ab1c2a0e6bb2fe9bc87bc04009a3a7e","tarball":"http://registry-npm.ywwl.com/debounceify/download/debounceify-1.1.0.tgz","fileCount":5,"unpackedSize":3889,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDbzW0TD46DXZ7ZJP9hkpe8czyMtqyjynX5cep1wX1CLAiAQmgCkmHPynFn/dFqbJCEs+A30o7MQKLD4JqI81XMRnA=="}],"size":1941,"noattachment":false,"key":"/debounceify/-/debounceify-1.1.0.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/debounceify_1.1.0_1705070503300_0.9628001987911556"},"_hasShrinkwrap":false,"readme":"# debounceify\n\nTiny async debouncer\n\n```\nnpm install debounceify\n```\n\n## Usage\n\n``` js\nconst debounceify = require('debounceify')\n\nconst debounced = debounceify(async function () {\n  console.log('Running...')\n  await new Promise(resolve => setTimeout(1000, resolve))\n})\n\nconst a = debounced() // triggers the about function\nconst b = debounced()\nconst c = debounced()\nconst d = debounced() // these last 3 wait for the first one to finish\n                      // then trigger one more.\n\nawait a\nawait b\nawait c\nawait d\n```\n\n## API\n\n#### `fn = debounceify(asyncFunction)`\n\nDebounces the `asyncFunction` so that\n\n1. No parallel executions of `asyncFunction` will happen\n2. Debounces the stack, so if 10 calls happen while `asyncFunction` is running only one more will be triggered when it finishes.\n3. Forwards errors and return values.\n\n#### `debounceify.running`\n\nThe active running job, `null` if none.\n\n## License\n\nMIT\n","publish_time":1705070503457,"_cnpm_publish_time":1705070503457,"dist-tags":{"latest":"1.1.0"}}