{"name":"async-time","version":"0.0.0","description":"Time async functions using async-done for execution and completion. ","main":"index.js","scripts":{"test":"tap ./test"},"repository":{"type":"git","url":"https://github.com/phated/async-time"},"keywords":["async","done","time","streams","promises","callbacks","continuations"],"author":{"name":"Blaine Bublitz","email":"blaine@iceddev.com","url":"http://iceddev.com/"},"license":"MIT","bugs":{"url":"https://github.com/phated/async-time/issues"},"homepage":"https://github.com/phated/async-time","dependencies":{"async-done":"^0.2.0","uuid":"^1.4.1"},"devDependencies":{"tap":"^0.4.11"},"gitHead":"ee2657cad7cd2f92cf5cd9e29d58235cb4ee0a71","_id":"async-time@0.0.0","_shasum":"04c52aca854b4a8d9a3f597bcf35380bdf525fe3","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"phated","email":"blaine@iceddev.com"},"maintainers":[{"name":"phated","email":"blaine@iceddev.com"}],"dist":{"shasum":"04c52aca854b4a8d9a3f597bcf35380bdf525fe3","tarball":"http://registry-npm.ywwl.com/async-time/download/async-time-0.0.0.tgz","integrity":"sha512-3Cswnfn2SAp/GbBngK+hYGHUb9Wm1LY+KIniASjOVcH4WYFTJtRhXAvvpfUhBaPuR9z2TqdRpqPd+FU3ZAp4Xw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAKzIRnvoHIPQSeS/LYFzuMeB8sEh538M42ufn/s35b9AiEA82qQhh5yYX80dFQrcXKXWa2KZRlouGZQE1rjoRFCW1Q="}],"size":3067,"noattachment":false,"key":"/async-time/-/async-time-0.0.0.tgz"},"directories":{},"readme":"async-time\n==========\n\n[![Build Status](https://travis-ci.org/phated/async-time.svg?branch=master)](https://travis-ci.org/phated/async-time)\n\nTime async functions using async-done for execution and completion.\n\n## Usage\n\n```js\nvar EE = require('events').EventEmitter;\n\nvar createTimer = require('async-time');\n\nvar bus = new EE();\nvar asyncTime = createTimer(bus);\n\n// listen for timing events\nbus.on('start', function(evt){\n  // function has started\n  console.log(evt);\n});\n\nbus.on('stop', function(evt){\n  // function has stopped\n  console.log(evt);\n});\n\nasyncTime(function(cb){\n  // do async things\n  cb(null, 2);\n}, function(err, res){\n  // `error` will be undefined on successful execution of the first function.\n  // `result` will be the result from the first function.\n})\n```\n\n## API\n\n__Once a timing function is created, it is used the same as [`async-done`](https://github.com/phated/async-done).__\n\n### `createTimer(EventEmitter)` => Function\n\nThe main export is a function that allows you to create a timing function.\n\nYou must pass it an `EventEmitter` instance (or an object with `emit` and `on` methods) or it will throw.\n\nThe `EventEmitter` instance is the bus timing events are published on.\n\n### `asyncTime(fn, callback)`\n\nSee [`async-done`](https://github.com/phated/async-done) docs.\n\n### Events\n\n#### `start`\n\nThe event fired when a function begins.\n\n__Properties:__\n* `id`: uuid generated for each function. Useful for tying start and end events together.\n* `name`: name property of the function given to `asyncTime`.\n* `timestamp`: timestamp of when the function started.\n\n#### `stop`\n\nThe event fired when a function finishes.\n\n__Properties:__\n* `id`: uuid generated for each function. Useful for tying start and end events together.\n* `name`: name property of the function given to `asyncTime`.\n* `timestamp`: timestamp of when the function started.\n* `duration`: high resolution time between start and stop events. Generated by `process.hrtime(startTime)`\n","publish_time":1403398120519,"_cnpm_publish_time":1403398120519,"dist-tags":{"latest":"0.0.1"}}