{"name":"q-promise","version":"0.2.2","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":"3720f03c4773b64c38fddc9b132604d0a6a8b1cb","_id":"q-promise@0.2.2","_shasum":"7e5281ec163a592e0f31eb4d2c1ca132173aac4c","_from":".","_npmVersion":"3.8.5","_nodeVersion":"4.4.2","_npmUser":{"name":"jgermade","email":"jesus@germade.es"},"dist":{"shasum":"7e5281ec163a592e0f31eb4d2c1ca132173aac4c","tarball":"http://registry-npm.ywwl.com/q-promise/download/q-promise-0.2.2.tgz","integrity":"sha512-jE9LCZNtgCErviIWE/yIL8SySbQQPCI5sjPj04qdq6/MVuVh3wTvDmEfCxhWm7fboV8z61gZvuQnyH54rRFO4A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAorCiJq3k7kCTmLkuSvYQ9U7ZHGEepUANUNoNFOH/q7AiAXRV+yy+ZInx8mpe5zBV8KTwG1bX6eB0gYCApQwQCrHQ=="}],"size":4533,"noattachment":false,"key":"/q-promise/-/q-promise-0.2.2.tgz"},"maintainers":[{"name":"jgermade","email":"jesus@germade.es"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/q-promise-0.2.2.tgz_1460122051724_0.20561436610296369"},"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":1460122054238,"_cnpm_publish_time":1460122054238,"dist-tags":{"latest":"1.0.0"}}