{"name":"q-promise","version":"0.3.1","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":"^0.13.22","karma-chai":"^0.1.0","karma-chrome-launcher":"^0.2.3","karma-firefox-launcher":"^0.1.7","karma-mocha":"^0.2.2","karma-story-reporter":"^0.3.1","mocha":"^2.4.5","nitro":"^1.5.74"},"gitHead":"d4300988ff87cb035aa961be91c94b39e35e0711","_id":"q-promise@0.3.1","_shasum":"229dcc07c9efa698d6b97f75b0a0be5a5919ee9d","_from":".","_npmVersion":"3.9.5","_nodeVersion":"4.4.5","_npmUser":{"name":"jgermade","email":"jesus@germade.es"},"dist":{"shasum":"229dcc07c9efa698d6b97f75b0a0be5a5919ee9d","tarball":"http://registry-npm.ywwl.com/q-promise/download/q-promise-0.3.1.tgz","integrity":"sha512-BgnBKqOhBsTT+iQ77pjJKgC+aN78BEvUQIPdVkQ4harxmULNrujKJnPZBsk1hvgWnaRG+7ktfMB7o7wOzki3ZQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF37qQb+pJgNDT7xNSkVhV1S3cMvg1war1syhGskDgy7AiA6ik6Na3qQ9PPEg3b8w2md5NpBrlSxtxeEkoX7s55GtQ=="}],"size":4864,"noattachment":false,"key":"/q-promise/-/q-promise-0.3.1.tgz"},"maintainers":[{"name":"jgermade","email":"jesus@germade.es"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/q-promise-0.3.1.tgz_1466642521314_0.8380073248408735"},"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":1466642523424,"_cnpm_publish_time":1466642523424,"dist-tags":{"latest":"1.0.0"}}