{"name":"q-promise","version":"1.0.0","description":"promise polyfill with add-ons","main":"q.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git+ssh://git@github.com/jstools/q-promise.git"},"keywords":["promise","polyfill","add-ons","when","es6"],"author":{"name":"Jesús Germade","email":"jesus@germade.es"},"license":"MIT","bugs":{"url":"https://github.com/jstools/q-promise/issues"},"homepage":"https://github.com/jstools/q-promise#readme","devDependencies":{"chai":"^3.5.0","karma":"^1.2.0","karma-chai":"^0.1.0","karma-chrome-launcher":"^2.0.0","karma-firefox-launcher":"^1.0.0","karma-mocha":"^1.1.1","karma-story-reporter":"^0.3.1","mocha":"^3.0.2","nitro":"^1.10.8","promises-aplus-tests":"^2.1.2"},"gitHead":"4f56c958436eb6ea98db2ade8192e26c73b7c650","_id":"q-promise@1.0.0","_shasum":"3d68dd477a78d8890e7ba29926bbdb82891c4467","_from":".","_npmVersion":"3.10.9","_nodeVersion":"6.9.1","_npmUser":{"name":"jgermade","email":"jesus@germade.es"},"dist":{"shasum":"3d68dd477a78d8890e7ba29926bbdb82891c4467","tarball":"http://registry-npm.ywwl.com/q-promise/download/q-promise-1.0.0.tgz","integrity":"sha512-kkCuzm4oLgX3jjQ4Naui4Vxgi4t9f5Rcki8XlIBcxeawybq65TLeJJ0hZiLrH5NTz/KR/C4FpExoR1ESbGx9sA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEMxt6/6WTmDkBD2AFsDAJVLTF8qc1ZtmisT7eBye+I6AiACU9iqtgJjxnMekoYsCL6wAa3dbu37cjMC+A7PiXo12A=="}],"size":6313,"noattachment":false,"key":"/q-promise/-/q-promise-1.0.0.tgz"},"maintainers":[{"name":"jgermade","email":"jesus@germade.es"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/q-promise-1.0.0.tgz_1481246475595_0.14921933482401073"},"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":1481246477240,"_cnpm_publish_time":1481246477240,"dist-tags":{"latest":"1.0.0"}}