{"_id":"guard","_rev":"10-7a975663635738492fb5d0bc8f006e80","name":"guard","description":"Trivial guard: triggers callback when internal counter reaches 0.","dist-tags":{"latest":"0.1.2"},"versions":{"0.0.1":{"name":"guard","version":"0.0.1","description":"Trivial guard: triggers callback when internal counter reaches 0.","main":"lib/guard.js","directories":{"test":"test"},"scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/code42day/guard.git"},"keywords":["async"],"author":{"name":"Damian Krzeminski","email":"pirxpilot@code42day.com"},"license":"MIT","devDependencies":{"mocha":"~1","jshint":"~0"},"_id":"guard@0.0.1","dist":{"shasum":"0a80845aefff8f45da56445184dca0528411f39d","tarball":"https://registry.npmjs.org/guard/-/guard-0.0.1.tgz","integrity":"sha512-DY1iJ51l87Bbs7OvFFPHLsc5YXeWPRjD40UAeTc92KvdBK7M5k/oc6f9aMHYm6cz+GeE7r1v25MUOo6xG/JJdw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDsd/NN3XDqM/l8j5bWaLaSBE/AQZGYUezW2Ma41ZuGNAiA0t2PV4zLWGKUwZr7AWwSVobWGpQVKOvuMD4CdviSgjQ=="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"pirxpilot","email":"pirxpilot@code42day.org"},"maintainers":[{"name":"pirxpilot","email":"pirxpilot@code42day.org"}]},"0.1.0":{"name":"guard","version":"0.1.0","description":"Trivial guard: triggers callback when internal counter reaches 0.","main":"lib/guard.js","directories":{"test":"test"},"scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/code42day/guard.git"},"keywords":["async"],"author":{"name":"Damian Krzeminski","email":"pirxpilot@code42day.com"},"license":"MIT","devDependencies":{"mocha":"~1","jshint":"~0"},"_id":"guard@0.1.0","dist":{"shasum":"fd9f3b4f43e4a979a97c4c97e900acfb69bbdb9f","tarball":"https://registry.npmjs.org/guard/-/guard-0.1.0.tgz","integrity":"sha512-bZH1DXMoceEtDsBl9PHbkP+wToklznYHLa1qKo5ZiTERgYSUR2UZfMmzwLS3b+2tCoE9ECc2ol0rgawb01c2wQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDwtmaDhuFedO3OJ3w1JL9SY1tQVQsrsr3i2kiW3PY02AiEA5ud9yzXfXM02nQoBgiGhnI0Z1JNRQhvNwYVXJnr4iCc="}]},"_npmVersion":"1.2.0","_npmUser":{"name":"pirxpilot","email":"pirxpilot@code42day.org"},"maintainers":[{"name":"pirxpilot","email":"pirxpilot@code42day.org"}]},"0.1.1":{"name":"guard","version":"0.1.1","description":"Trivial guard: triggers callback when internal counter reaches 0.","main":"lib/guard.js","directories":{"test":"test"},"scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/code42day/guard.git"},"keywords":["async"],"author":{"name":"Damian Krzeminski","email":"pirxpilot@code42day.com"},"license":"MIT","devDependencies":{"mocha":"~1","jshint":"~2"},"bugs":{"url":"https://github.com/code42day/guard/issues"},"_id":"guard@0.1.1","dist":{"shasum":"243e7613537920942ccb8244074a9074585bfffe","tarball":"https://registry.npmjs.org/guard/-/guard-0.1.1.tgz","integrity":"sha512-ofoS7Na3G9peQb1Rj2/H2a1eSltDFXHrdgUJWGJRZrv12nL5esNscdLjHhLxtG9J/pmYQ62nYyYN+Nr71x2ZCg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAPh1CmxG6DvOXO9YzwliA5w3Gex8Y9WV6BgxxxzXC9IAiEAgBrLByIWCWSY/0Z0Ced/o2ArhfqAHgJSZiu3xJhKmWQ="}]},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"pirxpilot","email":"pirxpilot@code42day.org"},"maintainers":[{"name":"pirxpilot","email":"pirxpilot@code42day.org"}]},"0.1.2":{"name":"guard","version":"0.1.2","description":"Trivial guard: triggers callback when internal counter reaches 0.","main":"lib/guard.js","directories":{"test":"test"},"scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/pirxpilot/guard.git"},"keywords":["async"],"author":{"name":"Damian Krzeminski","email":"pirxpilot@furkot.com"},"license":"MIT","devDependencies":{"mocha":"~1","jshint":"~2"},"gitHead":"7902c1a490db6bbbf26fdf830e605bb5fc9bda83","bugs":{"url":"https://github.com/pirxpilot/guard/issues"},"homepage":"https://github.com/pirxpilot/guard#readme","_id":"guard@0.1.2","_shasum":"04d3012488b1acbdc65f2066624f13a7f18be805","_from":".","_npmVersion":"4.0.5","_nodeVersion":"4.6.2","_npmUser":{"name":"pirxpilot","email":"pirxpilot@furkot.com"},"dist":{"shasum":"04d3012488b1acbdc65f2066624f13a7f18be805","tarball":"https://registry.npmjs.org/guard/-/guard-0.1.2.tgz","integrity":"sha512-4mEXwn2J5XbTUrcQvT/Sa5gDBO1jbthwITPEhNTJ4P2hEZ++UgDBBT4LQrdMgAteHARptbDoNbSlH+39zumZLg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3v2tLEfG7jEN5aAhosYAjvb0FNevJosAX3ixQlmX5mgIhAPIjQjVMptAaIanGWJF2XKG07doQvEcNJoKA6Sa+ULjp"}]},"maintainers":[{"name":"pirxpilot","email":"pirxpilot@code42day.org"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/guard-0.1.2.tgz_1487839813901_0.9001924998592585"}}},"readme":"[![Build Status](https://secure.travis-ci.org/pirxpilot/guard.png)](http://travis-ci.org/pirxpilot/guard)\n[![NPM version](https://badge.fury.io/js/guard.png)](http://badge.fury.io/js/guard)\n\n# guard \n\nTrivial guard: triggers callback when internal counter reaches 0.\n\n## API\n\nCreate ```guard``` passing callback function. Call ```on()``` and ```off()``` to increase and\ndecrease internal counter.\n\n    g = guard(function() {\n      console.log('Done...')\n    });\n    g.on();\n    g.on();\n    g.off();\n    g.off(); // prints 'Done...'\n\nYou can initialize the counter when creating a new guard.\n\n    g = guard(function() {\n      console.log('Done...')\n    }, 2);\n    g.on();\n    // call off 3 times\n    g.off();\n    g.off();\n    g.off(); // prints 'Done...'\n\n\nIn addition to `done` callback you can setup callbacks when counter reaches a certain value during\n`on` or `off`\n\n    g = guard()\n      .onCallback(100, function() {\n        // called when internal counter is 100 after increment\n      })\n      .offCallback(10, function() {\n        // called when internal counter is 10 after decrement\n      });\n\n## License\n\nMIT\n","maintainers":[{"name":"pirxpilot","email":"pirxpilot@code42day.org"}],"time":{"modified":"2022-06-18T16:28:16.184Z","created":"2012-12-17T20:25:35.221Z","0.0.1":"2012-12-17T20:25:36.235Z","0.1.0":"2013-03-04T01:23:22.065Z","0.1.1":"2013-09-02T15:12:30.795Z","0.1.2":"2017-02-23T08:50:14.162Z"},"author":{"name":"Damian Krzeminski","email":"pirxpilot@furkot.com"},"repository":{"type":"git","url":"git://github.com/pirxpilot/guard.git"},"homepage":"https://github.com/pirxpilot/guard#readme","keywords":["async"],"bugs":{"url":"https://github.com/pirxpilot/guard/issues"},"license":"MIT","readmeFilename":"Readme.md"}