{"name":"q-promise","version":"0.3.7","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.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.9.9"},"gitHead":"a5cfcdc08cda490ef961be7a1e8e84659f0f6a79","_id":"q-promise@0.3.7","_shasum":"22f717c87c9f3df136657a6135d2c01aa3cb573a","_from":".","_npmVersion":"3.10.6","_nodeVersion":"4.5.0","_npmUser":{"name":"jgermade","email":"jesus@germade.es"},"dist":{"shasum":"22f717c87c9f3df136657a6135d2c01aa3cb573a","tarball":"http://registry-npm.ywwl.com/q-promise/download/q-promise-0.3.7.tgz","integrity":"sha512-n3f0fH6ANI57J76WevzepYyfSDIUr9UXY1OS0bz7+DLUKy8N45iMWvi/ogIZrQbnhczMoettDyKwuI0JofDDCg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDSw7i1dXLqfyotNWTmPdT+pdmuf9SUvxb2o5WVAq7+wAiApxl7LW4sLptXvUEaExqqsJP/0cDrPjkN8az8ZUg7dvQ=="}],"size":5324,"noattachment":false,"key":"/q-promise/-/q-promise-0.3.7.tgz"},"maintainers":[{"name":"jgermade","email":"jesus@germade.es"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/q-promise-0.3.7.tgz_1474889604966_0.22462536697275937"},"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":1474889606313,"_cnpm_publish_time":1474889606313,"dist-tags":{"latest":"1.0.0"}}