{"name":"q-promise","version":"0.2.5","description":"promise polyfill with add-ons","main":"lib/q.js","scripts":{"test":"node make lint && $(npm bin)/mocha tests && node make build && $(npm bin)/karma start karma.conf.js"},"repository":{"type":"git","url":"git+ssh://git@github.com/jstools/promises-plus.git"},"keywords":["promise","polyfill","add-ons","when"],"author":{"name":"Jesús Germade","email":"jesus@germade.es"},"license":"MIT","bugs":{"url":"https://github.com/jstools/promises-plus/issues"},"homepage":"https://github.com/jstools/promises-plus#readme","devDependencies":{"chai":"^3.4.1","karma":"^0.13.15","karma-chai":"^0.1.0","karma-chrome-launcher":"^0.2.2","karma-firefox-launcher":"^0.1.7","karma-mocha":"^0.2.1","karma-story-reporter":"^0.3.1","mocha":"^2.3.4","nitro":"^1.5.41"},"gitHead":"76b7b41d3486e992bca24b05c7874ef2dfc20aef","_id":"q-promise@0.2.5","_shasum":"2f443a8213d56030d1ba28758a74e63a9838689c","_from":".","_npmVersion":"3.8.5","_nodeVersion":"4.4.2","_npmUser":{"name":"jgermade","email":"jesus@germade.es"},"dist":{"shasum":"2f443a8213d56030d1ba28758a74e63a9838689c","tarball":"http://registry-npm.ywwl.com/q-promise/download/q-promise-0.2.5.tgz","integrity":"sha512-QZuy/MHPQqZ7w8PnAIED28B7xQMl03DIv4shtyLUVQ/qQPQ+eHiPKmSR60t2LQ21hF23Gj2L8tcqqN1yAqyDQA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICYTVAziNX7nQ+8+h7HbZTg+BurzUQeANHbAnDQ+KeLaAiB6ocyzYGyPNkrVm9rYzX53sJIjGYkpxODYNA01SXIbcQ=="}],"size":4609,"noattachment":false,"key":"/q-promise/-/q-promise-0.2.5.tgz"},"maintainers":[{"name":"jgermade","email":"jesus@germade.es"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/q-promise-0.2.5.tgz_1460125887472_0.6026962727773935"},"readme":"q-promise [![](https://img.shields.io/npm/v/q-promise.svg)](https://www.npmjs.com/package/q-promise) [![](https://img.shields.io/bower/v/q-promise.svg)](http://bower.io/search/?q=q-promise)\n==================\n[![travis](https://cdn.travis-ci.org/images/favicon-662edf026745110e8203d8cf38d1d325.png)](https://travis-ci.org/jstools/q-promise)\n[![Build Status](https://travis-ci.org/jstools/q-promise.svg?branch=master)](https://travis-ci.org/jstools/q-promise)\n[![Wercker](http://wercker.com/favicon.ico)](https://app.wercker.com/project/bykey/be7db1dae8daa1a31b992c75d8c9cf83)\n[![wercker status](https://app.wercker.com/status/be7db1dae8daa1a31b992c75d8c9cf83/s \"wercker status\")](https://app.wercker.com/project/bykey/be7db1dae8daa1a31b992c75d8c9cf83)\n[![](https://img.shields.io/npm/dm/q-promise.svg)](https://www.npmjs.com/package/q-promise)\n\n> Full [Promises/A+](https://github.com/promises-aplus/promises-spec) [compliance](https://github.com/promises-aplus/promises-tests)\n\n[<img src=\"https://rawgit.com/promises-aplus/promises-spec/master/logo.svg\" width=\"48\">](https://github.com/promises-aplus/promises-spec)\n\n## Installation\n```.sh\nnpm install q-promise --save\n\n# alternatively you can use bower (minified version by default)\nbower install q-promise --save\n```\n\n## [ES6 Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\n``` js\n// q-promise respects the es6 promise specification\n// you can use q-promise as global polyfill\n\nif( !window.Promise ) {\n  window.Promise = $q;\n}\n```\n\n## Example\n``` js\n$q(function (resolve, reject) {\n        resolve('gogogo!');\n    })\n\n    .then(function (result) {\n        console.log('checkpoint 1', result);\n        throw 'whoops!';\n    })\n\n    .then(function (result) {\n        console.log('checkpoint 2', result);\n    },function (result) {\n        console.log('checkpoint 2.1', result);\n        return qPromise(function (resolve, reject) {\n            setTimeout(function () { resolve('all right!'); }, 400);\n        });\n    })\n\n    .then(function (result) {\n        console.log('checkpoint 3', result);\n    }, function (reason) {\n        console.log('checkpoint 3.1', reason);\n    })\n;\n```\noutput:\n```.sh\ncheckpoint 1 gogogo!\ncheckpoint 2.1 whoops!\n# elapsed 400ms\ncheckpoint 3 all right!\n```\n\nTests\n-----\n``` sh\nmake test\n```\n","publish_time":1460125889923,"_cnpm_publish_time":1460125889923,"dist-tags":{"latest":"1.0.0"}}