{"_id":"promise-ts","_rev":"3348632","name":"promise-ts","description":"TypeScript promises for Node.js.","dist-tags":{"latest":"0.2.2"},"maintainers":[{"name":"jedhunsaker","email":""}],"time":{"modified":"2024-08-07T03:57:35.000Z","created":"2014-01-06T05:02:39.805Z","0.2.2":"2014-01-31T06:48:08.354Z","0.2.1":"2014-01-31T06:17:36.460Z","0.2.0":"2014-01-30T05:08:08.111Z","0.1.0":"2014-01-06T05:02:39.805Z"},"users":{},"author":{"name":"Jed Mao","email":"jed.hunsaker+npm@gmail.com"},"repository":{"type":"git","url":"https://github.com/jedmao/promise-ts.git"},"versions":{"0.2.2":{"name":"promise-ts","version":"0.2.2","description":"TypeScript promises for Node.js.","main":"./lib/api.js","scripts":{"test":"gulp test"},"repository":{"type":"git","url":"https://github.com/jedmao/promise-ts.git"},"keywords":["promise","promises","deferred","jquery","typescript"],"author":{"name":"Jed Mao","email":"jed.hunsaker+npm@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/jedmao/promise-ts/issues"},"homepage":"https://github.com/jedmao/promise-ts","devDependencies":{"bower":"~1.2.8","chai":"~1.8.1","gulp":"~3.5.0","gulp-clean":"~0.2.4","gulp-mocha":"~0.4.1","gulp-watch":"~0.5.0","mocha":"~1.16.2","run-sequence":"~0.3.2","sinon":"~1.7.3","sinon-chai":"~2.4.0","ts-compiler":"~0.1.0"},"dependencies":{"typescript-require":"~0.2.6"},"_id":"promise-ts@0.2.2","dist":{"shasum":"7bc5bd7693cac777ae63f4cfda3dc8ed30f0a9ce","size":4192,"noattachment":false,"key":"/promise-ts/-/promise-ts-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/promise-ts/download/promise-ts-0.2.2.tgz"},"_from":"https://github.com/jedmao/promise-ts/archive/v0.2.2.tar.gz","_resolved":"https://github.com/jedmao/promise-ts/archive/v0.2.2.tar.gz","_npmVersion":"1.3.24","_npmUser":{"name":"jedhunsaker","email":"jed.hunsaker@gmail.com"},"maintainers":[{"name":"jedhunsaker","email":""}],"directories":{},"publish_time":1391150888354,"_hasShrinkwrap":false,"_cnpm_publish_time":1391150888354,"_cnpmcore_publish_time":"2021-12-16T20:13:53.287Z"},"0.2.1":{"name":"promise-ts","version":"0.2.1","description":"TypeScript promises for Node.js.","main":"./lib/api.js","scripts":{"test":"gulp test"},"repository":{"type":"git","url":"https://github.com/jedmao/promise-ts.git"},"keywords":["promise","promises","deferred","jquery","typescript"],"author":{"name":"Jed Mao","email":"jed.hunsaker+npm@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/jedmao/promise-ts/issues"},"homepage":"https://github.com/jedmao/promise-ts","devDependencies":{"bower":"~1.2.8","chai":"~1.8.1","gulp":"~3.5.0","gulp-clean":"~0.2.4","gulp-mocha":"~0.4.1","gulp-watch":"~0.5.0","mocha":"~1.16.2","run-sequence":"~0.3.2","sinon":"~1.7.3","sinon-chai":"~2.4.0","ts-compiler":"~0.1.0"},"dependencies":{"typescript-require":"~0.2.6"},"_id":"promise-ts@0.2.1","dist":{"shasum":"8ff99fbba1037c3445c96dc29a44ef7ce952c132","size":4158,"noattachment":false,"key":"/promise-ts/-/promise-ts-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/promise-ts/download/promise-ts-0.2.1.tgz"},"_from":"https://github.com/jedmao/promise-ts/archive/v0.2.1.tar.gz","_resolved":"https://github.com/jedmao/promise-ts/archive/v0.2.1.tar.gz","_npmVersion":"1.3.24","_npmUser":{"name":"jedhunsaker","email":"jed.hunsaker@gmail.com"},"maintainers":[{"name":"jedhunsaker","email":""}],"directories":{},"publish_time":1391149056460,"_hasShrinkwrap":false,"_cnpm_publish_time":1391149056460,"_cnpmcore_publish_time":"2021-12-16T20:13:53.515Z"},"0.2.0":{"name":"promise-ts","version":"0.2.0","description":"TypeScript promises for Node.js.","main":"./lib/api.js","scripts":{"test":"gulp test"},"repository":{"type":"git","url":"https://github.com/jedmao/promise-ts.git"},"keywords":["promise","promises","deferred","jquery","typescript"],"author":{"name":"Jed Mao","email":"jed.hunsaker+npm@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/jedmao/promise-ts/issues"},"homepage":"https://github.com/jedmao/promise-ts","devDependencies":{"bower":"~1.2.8","chai":"~1.8.1","gulp":"~3.5.0","gulp-clean":"~0.2.4","gulp-mocha":"~0.4.1","gulp-watch":"~0.5.0","mocha":"~1.16.2","run-sequence":"~0.3.2","sinon":"~1.7.3","sinon-chai":"~2.4.0","ts-compiler":"~0.1.0"},"dependencies":{"typescript-require":"~0.2.6"},"_id":"promise-ts@0.2.0","dist":{"shasum":"ac17955ed76a59915721d5c88c8aa80a47698b15","size":4156,"noattachment":false,"key":"/promise-ts/-/promise-ts-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/promise-ts/download/promise-ts-0.2.0.tgz"},"_from":"https://github.com/jedmao/promise-ts/archive/v0.2.0.tar.gz","_resolved":"https://github.com/jedmao/promise-ts/archive/v0.2.0.tar.gz","_npmVersion":"1.3.24","_npmUser":{"name":"jedhunsaker","email":"jed.hunsaker@gmail.com"},"maintainers":[{"name":"jedhunsaker","email":""}],"directories":{},"publish_time":1391058488111,"_hasShrinkwrap":false,"_cnpm_publish_time":1391058488111,"_cnpmcore_publish_time":"2021-12-16T20:13:54.085Z"},"0.1.0":{"name":"promise-ts","version":"0.1.0","description":"TypeScript promises for Node.js.","main":"./lib/promise.js","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/jedmao/promise-ts.git"},"keywords":["promise","promises","deferred","jquery","typescript"],"author":{"name":"Jed Mao","email":"jed.hunsaker+npm@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/jedmao/promise-ts/issues"},"homepage":"https://github.com/jedmao/promise-ts","devDependencies":{"bower":"~1.2.8","chai":"~1.8.1","grunt":"~0.4.2","grunt-contrib-clean":"~0.5.0","grunt-contrib-watch":"~0.5.3","grunt-mocha-test":"~0.8.1","grunt-typescript":"~0.2.7","mocha":"~1.16.2","sinon":"~1.7.3","sinon-chai":"~2.4.0"},"readmeFilename":"README.md","_id":"promise-ts@0.1.0","dist":{"shasum":"774ecac2bc682a5b24036ba92ba09ce1cd5c511c","size":21983,"noattachment":false,"key":"/promise-ts/-/promise-ts-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/promise-ts/download/promise-ts-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"jedhunsaker","email":"jed.hunsaker@gmail.com"},"maintainers":[{"name":"jedhunsaker","email":""}],"directories":{},"publish_time":1388984559805,"_hasShrinkwrap":false,"_cnpm_publish_time":1388984559805,"_cnpmcore_publish_time":"2021-12-16T20:13:54.368Z"}},"readme":"#promise-ts\n\n[![Build Status][]](https://travis-ci.org/jedmao/promise-ts)\n[![Dependency Status][]](https://gemnasium.com/jedmao/promise-ts)\n[![NPM version][]](http://badge.fury.io/js/promise-ts)\n[![Views][]](https://sourcegraph.com/github.com/jedmao/promise-ts)\n\n[![NPM](https://nodei.co/npm/promise-ts.png?downloads=true)](https://nodei.co/npm/promise-ts/)\n\nPromises for Node.js, written in TypeScript and distributed in JavaScript, along\nwith a TypeScript definition file at the root (promise.d.ts). These promise classes\nand functions \"mostly\" behave like jQuery promises, so you can refer to\n[jQuery documentation][] for more detailed information.\n\nThe following classes and function are made available to you:\n\n1. Deferred object ([jQuery doc](http://api.jquery.com/jQuery.Deferred/))\n1. Promise object ([jQuery doc](http://api.jquery.com/Types/#Promise))\n1. when function ([jQuery doc](http://api.jquery.com/jQuery.when/))\n\nThe only known differences between the jQuery counterparts are in cases like\n[jQuery's deferred.done][], where the documentation states, \"The `deferred.done()`\nmethod accepts one or more arguments, all of which can be either a single function\nor an array of functions.\" In this library's case, it's just a TypeScript\n`(...callbacks: Function[])` method signature. Contributions are welcome to fix\nthis, but I didn't have the need to go down that road myself.\n\n\n## Example Usage\n\n### TypeScript\n\n```ts\n///<reference path='node_modules/promise-ts/promise-ts.d.ts'/>\nimport promise = require('promise-ts');\nvar Deferred = promise.Deferred;\nvar when = promise.when; // not used in this example, but handy.\n\nfunction doSomethingAsync(): promise.Promise {\n    var d = new Deferred();\n    setTimeout(() => {\n        // time consuming operations\n        d.resolve('foo');\n    });\n    return d.promise;\n}\n\ndoSomethingAsync.done(result => {\n    // result === 'foo';\n});\n```\n\n### JavaScript\n\n```js\nvar promise = require('promise-ts');\nvar Deferred = promise.Deferred;\nvar when = promise.when; // not used in this example, but handy.\n\nfunction doSomethingAsync() {\n    var d = new Deferred();\n    setTimeout(function() {\n        // time consuming operations\n        d.resolve('foo');\n    });\n    return d.promise;\n}\n\ndoSomethingAsync.done(function(result) {\n    // result === 'foo';\n});\n```\n\nSee [the specs][] for more examples. The library and specs have both been written\nto satisfy the jQuery usages.\n\n\n## License\n\nMIT © [Jed Mao](https://github.com/jedmao)\n\n\n[Build Status]: https://travis-ci.org/jedmao/promise-ts.png?branch=master\n[Dependency Status]: https://gemnasium.com/jedmao/promise-ts.png\n[NPM Version]: https://badge.fury.io/js/promise-ts.png\n[Views]: https://sourcegraph.com/api/repos/github.com/jedmao/promise-ts/counters/views-24h.png\n[jQuery documentation]: http://api.jquery.com/category/deferred-object/\n[jQuery's deferred.done]: http://api.jquery.com/deferred.done/\n[the specs]: blob/master/test/lib/promises.ts\n\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/jedmao/promise-ts/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n\n","_attachments":{},"homepage":"https://github.com/jedmao/promise-ts","bugs":{"url":"https://github.com/jedmao/promise-ts/issues"},"license":"MIT"}