{"_id":"callback-count","_rev":"20-0d1b2a5b59666677fcebd4c8dc4b6ad3","name":"callback-count","description":"Count your callbacks before continuing. A tiny control flow helper that supports dynamic counting.","dist-tags":{"latest":"0.2.0"},"versions":{"0.0.1":{"name":"callback-count","version":"0.0.1","description":"Count your callbacks before continuing. A tiny control flow helper that supports dynamic counting.","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/tjmehta/callback-count.git"},"keywords":["callback","count","callback","count","counter","control","flow","next","done","dynamic"],"author":{"name":"Tejesh Mehta"},"license":"MIT","bugs":{"url":"https://github.com/tjmehta/callback-count/issues"},"homepage":"https://github.com/tjmehta/callback-count","_id":"callback-count@0.0.1","dist":{"shasum":"f1676f33ba4ff4d03119da0ee61f02de24657c0c","tarball":"https://registry.npmjs.org/callback-count/-/callback-count-0.0.1.tgz","integrity":"sha512-ntPZxobCO3SZWP0r6pmPnOFBmS0CywoJrvrB7V70rLQPR6htYBXK5CZ4o2vhVPn4aGJ2f1J2mVNRzWvakyEulg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDM9dm7+ntLuQnl6zb5QrYmuzMgITpNreKWivTGAdtTHgIhAITeSJhSjOoGqdNRimJh2NopFBIISBuuDRrCmmCPgA0b"}]},"_from":".","_npmVersion":"1.3.17","_npmUser":{"name":"tjmehta","email":"tj_mehta@hotmail.com"},"maintainers":[{"name":"tjmehta","email":"tj_mehta@hotmail.com"}]},"0.0.2":{"name":"callback-count","version":"0.0.2","description":"Count your callbacks before continuing. A tiny control flow helper that supports dynamic counting.","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/tjmehta/callback-count.git"},"keywords":["callback","count","callback","count","counter","control","flow","next","done","dynamic"],"author":{"name":"Tejesh Mehta"},"license":"MIT","bugs":{"url":"https://github.com/tjmehta/callback-count/issues"},"homepage":"https://github.com/tjmehta/callback-count","_id":"callback-count@0.0.2","dist":{"shasum":"33e0e5cdfb5b0e5d7a46a29d5aaf880fd938e5f8","tarball":"https://registry.npmjs.org/callback-count/-/callback-count-0.0.2.tgz","integrity":"sha512-knMn7mkppDQ5BDgaiyvDgPIHHnmo9GoGvVmqvBa+TUysq2Xm9p6uCSwqwo9GebHwrF/SV98E4HRJVIq+yYR4DA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHY2/RGmufcSJuvFi06iuKuwcCXbfvXdKICBX6E4EJKHAiEAqe+MBQlCdOjzHukDOHM1yp+ArkYrlLehsdFQV1vtvas="}]},"_from":".","_npmVersion":"1.3.17","_npmUser":{"name":"tjmehta","email":"tj_mehta@hotmail.com"},"maintainers":[{"name":"tjmehta","email":"tj_mehta@hotmail.com"}]},"0.0.3":{"name":"callback-count","version":"0.0.3","description":"Count your callbacks before continuing. A tiny control flow helper that supports dynamic counting.","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/tjmehta/callback-count.git"},"keywords":["callback","count","callback","count","counter","control","flow","next","done","dynamic"],"author":{"name":"Tejesh Mehta"},"license":"MIT","bugs":{"url":"https://github.com/tjmehta/callback-count/issues"},"homepage":"https://github.com/tjmehta/callback-count","_id":"callback-count@0.0.3","dist":{"shasum":"b3abfa8767c248bc834f13c92e488356ddce9f5c","tarball":"https://registry.npmjs.org/callback-count/-/callback-count-0.0.3.tgz","integrity":"sha512-fYV01y/541CaWxMwN9J8k2aznUx9jsONJlXnCGjIUTt9vFQdoNDTphn1jTHDqErdS6ZiFD2iadpMdIT4FJxvuQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICR7F5HKKIQWY76vHF9iShj5Nxhg1g070noDmiwUTZLdAiAQt9S+3ozrcayjGtxO479E+PtxnR3HKASGNS1SGCNMyQ=="}]},"_from":".","_npmVersion":"1.3.17","_npmUser":{"name":"tjmehta","email":"tj_mehta@hotmail.com"},"maintainers":[{"name":"tjmehta","email":"tj_mehta@hotmail.com"}]},"0.1.0":{"name":"callback-count","version":"0.1.0","description":"Count your callbacks before continuing. A tiny control flow helper that supports dynamic counting.","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/tjmehta/callback-count.git"},"keywords":["callback","count","callback","count","counter","control","flow","next","done","dynamic"],"author":{"name":"Tejesh Mehta"},"license":"MIT","bugs":{"url":"https://github.com/tjmehta/callback-count/issues"},"homepage":"https://github.com/tjmehta/callback-count","devDependencies":{"should":"^3.1.3","mocha":"^1.17.1"},"_id":"callback-count@0.1.0","dist":{"shasum":"481e4f68966bd71637a9ae238e0e42b3059188fd","tarball":"https://registry.npmjs.org/callback-count/-/callback-count-0.1.0.tgz","integrity":"sha512-CH7e2Dp8gL40JE9/iDmgZvRGzJQNF0wz/85wS6PnZnUZmdhn3SjaW8UtEqnkDHd5B+88EZdedAv1ndmsCb4nTA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCB47EK/MygNXADY4IerHlf2A7R16gKb6GxK5JPDStsMQIhAPYpTrywu6H0soR/oFWKO6COuaR1dysrNbMiSQY2fhkv"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"tjmehta","email":"tj_mehta@hotmail.com"},"maintainers":[{"name":"tjmehta","email":"tj_mehta@hotmail.com"}]},"0.2.0":{"name":"callback-count","version":"0.2.0","description":"Count your callbacks before continuing. A tiny control flow helper that supports dynamic counting.","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/tjmehta/callback-count.git"},"keywords":["callback","count","callback","count","counter","control","flow","next","done","dynamic"],"author":{"name":"Tejesh Mehta"},"license":"MIT","bugs":{"url":"https://github.com/tjmehta/callback-count/issues"},"homepage":"https://github.com/tjmehta/callback-count","devDependencies":{"should":"^3.1.3","mocha":"^1.17.1"},"dependencies":{"exists":"^1.0.0"},"gitHead":"e4d788024f670d3d9e20f2d17c1bc64c8c77fe8d","_id":"callback-count@0.2.0","_shasum":"7652687354d4275f30beb65d013e67a64c200a47","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.10.38","_npmUser":{"name":"tjmehta","email":"tejesh.mehta@gmail.com"},"maintainers":[{"name":"tjmehta","email":"tj_mehta@hotmail.com"}],"dist":{"shasum":"7652687354d4275f30beb65d013e67a64c200a47","tarball":"https://registry.npmjs.org/callback-count/-/callback-count-0.2.0.tgz","integrity":"sha512-GHjxRQd/t3HPmP1RNQW/3uH64oFi+bU4CYHcxsSDoBoLIG4qG5SsGRn2IRPQnDBhzl1QHIMvYR3yrY4CPzNCSg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4Bfo/6yleEhOn/haWcG+a6s5tNLDHoZ9Aq8Uto0VtGwIgLdZj/40epFdHv29cosf2RNmmfKDdzzk1uOWsfLa45PQ="}]}}},"readme":"callback-count [![Build Status](https://travis-ci.org/tjmehta/callback-count.png)](https://travis-ci.org/tjmehta/callback-count)\n==============\n\n#### Count callbacks before continuing, tiny control flow helper, allows dynamic counting. \n\n### Flow control\n```js\nvar callbackCount = require('callback-count');\nvar counter = callbackCount(done);\n\nsetTimeout(counter.inc().next, 100);\nsetTimeout(counter.inc().next, 100);\n\nfunction done (err) {\n  console.log('finished.');\n}\n```\n\n### .inc() allows you to dynamically update the number of callbacks you are expecting.\n```js\nvar callbackCount = require('callback-count');\nvar counter = callbackCount(done);\n\ncounter.inc().inc().inc();\ncounter.next().next().next();\n\nfunction done (err) {\n  console.log('finished.');\n}\n```\n\n### The constructor can take an initial value for the count expected\n```js\nvar callbackCount = require('callback-count');\nvar counter = callbackCount(3, done);\n\ncounter.next().next().next();\n\nfunction done (err) {\n  console.log('finished.');\n}\n```\n\n### .next() decrements the count and callsback when the count has reached 0\n```js\nvar counter = createCounter(3, done);\n\ncounter.next().next().next();\n\nfunction done (err) {\n  console.log(counter.count); // 0\n  console.log('finished.');\n}\n```\n\n### if .next() receives an error it will callback immediately\n```js\nvar counter = createCounter(3, done);\n\ncounter.next(new Error('boom'));\n\nfunction done (err) {\n  console.log(err.message); // boom\n}\n```\n\n### License: MIT\n","maintainers":[{"name":"tjmehta","email":"tj_mehta@hotmail.com"}],"time":{"modified":"2022-06-13T05:26:09.500Z","created":"2014-02-25T06:58:14.293Z","0.0.1":"2014-02-25T06:58:15.613Z","0.0.2":"2014-02-25T07:35:44.595Z","0.0.3":"2014-02-25T07:42:00.854Z","0.1.0":"2014-03-06T08:29:40.769Z","0.2.0":"2015-07-30T21:56:43.443Z"},"readmeFilename":"README.md","homepage":"https://github.com/tjmehta/callback-count","keywords":["callback","count","callback","count","counter","control","flow","next","done","dynamic"],"repository":{"type":"git","url":"git+https://github.com/tjmehta/callback-count.git"},"author":{"name":"Tejesh Mehta"},"bugs":{"url":"https://github.com/tjmehta/callback-count/issues"},"license":"MIT","users":{"sahilsk":true}}