{"dist":{"shasum":"183f827263509569ac32f3b52ead0ad490cb21dd","tarball":"https://registry.npmjs.org/future/-/future-2.2.0.tgz","integrity":"sha512-hf8dNAqIXnUL0O4b4rJkXu1HyIMfcwhWx8TU9haI+9zahtHEej09wnEMNXngv0PKLPm7NnNeuRcSHa/Xhf1WLg==","signatures":[{"sig":"MEYCIQC2ECC6HwiB3CLAItolDo4pD3QcKvJtpla4qYA58TMWAwIhAIO+5Dvur6X+Fuf5YGF2s89fK9DCo1k4y5LGWFrh6ne1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"future.js","name":"future","author":{"url":"http://coolaj86.info","name":"AJ ONeal","email":"coolaj86@gmail.com"},"readme":"Future\n----\n\nCreates a Future (aka Promise, Deferred, Subscription, Callback) object.\n\nInstallation\n---\n\nNode.JS (Server):\n\n    npm install future\n\nEnder.JS (Browser):\n\n    ender build future\n\nUsage\n---\n\n    var context = { \"foo\": \"bar\" }\n      , Future = require('future')\n      , future = Future(context)\n      , err\n      , message = \"Hello World!\"\n      ;\n\n    future.whenever(function (error, data) {\n      if (error) {\n        throw err;\n      }\n      console.log(this.foo + \" says: \" + data);\n    });\n\n    future.setTimeout(100);\n    future.deliver(err, message);\n\nOutput:\n\n    \"bar says: Hello World\"\n    FutureTimeout: timeout 100ms\n        at [object SomeObject]:x:y\n        ...\n\nAPI\n---\n\n**Core**\n\n  * `Futures.future(globalContext=null)` - creates a `Future` object and uses `globalContext` as the default `this` for callbacks\n\n  * `deliver(err, data, ...)` - Send a message (data) to all listeners (callbacks)\n\n  * `fulfill([err, data, ...])` - Prevent the sending of any future messages. If arguments are passed they will be `deliver`ed.\n\n  * `whenever(callback, [context])` - Listen to all messages, applying `context` if provided (passing `null` cancels `globalContext`)\n\n  * `when(callback, [context])` - Listen one-time only, then `removeCallback` automatically\n\n  * `setTimeout(ms)` - will sends a `FutureTimeout` error if no activity occurs within `ms`\n\n\n**Accessory**\n\n  * `errback(err)` - Useful for a peer-library requiring a method specifically for errbacks\n    * i.e. `jQuery`'s `$.ajax`\n\n  * `callback(data [, ...])` - Useful for a peer-library requiring a method which does not pass `err` as the first parameter\n    * i.e. `jQuery`'s `$.ajax`\n\n  * `removeCallback(callback, context=null)` - This callback and associated context will no longer receive messages\n\n  * `setAsap(on=true)` - New listeners get existing data (if available) rather than waiting until the next delivery (default on)\n\n  * `isFuture(obj)` - a best-effort guess as to whether or not an object is a Future\n\n  * `callbackCount(callback, context)` - The number of listening callbacks\n\n  * `deliveryCount(callback, context)` - The number of deliveries made\n\n  * `hasCallback(callback, context=null)` - Returns `true` if the callback is listening\n","engines":{"node":"*","ender":">= 0.5.0"},"_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"homepage":"https://github.com/coolaj86/futures","keywords":["flow-control","async","asynchronous","futures","promises","deferreds","util","browser"],"repository":{"url":"git://github.com/coolaj86/futures.git","type":"git"},"_npmVersion":"1.1.0-beta-10","description":"The promise / subscribe / deferred module of FuturesJS (Ender.JS and Node.JS)","directories":{"lib":"."},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"_nodeVersion":"v0.6.7","dependencies":{},"_defaultsLoaded":true,"devDependencies":{},"_engineSupported":true,"_id":"future@2.2.0","version":"2.2.0"}