{ "_args": [ [ { "raw": "q@^1.1.2", "scope": null, "escapedName": "q", "name": "q", "rawSpec": "^1.1.2", "spec": ">=1.1.2 <2.0.0", "type": "range" }, "/home/jdaugherty/work/GT2/GT2-Android/node_modules/decompress-zip" ] ], "_from": "q@>=1.1.2 <2.0.0", "_id": "q@1.5.1", "_inCache": true, "_location": "/q", "_nodeVersion": "0.10.32", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/q-1.5.1.tgz_1508435736930_0.7891315249726176" }, "_npmUser": { "name": "kriskowal", "email": "kris.kowal@cixar.com" }, "_npmVersion": "2.14.2", "_phantomChildren": {}, "_requested": { "raw": "q@^1.1.2", "scope": null, "escapedName": "q", "name": "q", "rawSpec": "^1.1.2", "spec": ">=1.1.2 <2.0.0", "type": "range" }, "_requiredBy": [ "/decompress-zip" ], "_resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", "_shasum": "7e32f75b41381291d04611f1bf14109ac00651d7", "_shrinkwrap": null, "_spec": "q@^1.1.2", "_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/decompress-zip", "author": { "name": "Kris Kowal", "email": "kris@cixar.com", "url": "https://github.com/kriskowal" }, "bugs": { "url": "http://github.com/kriskowal/q/issues" }, "contributors": [ { "name": "Kris Kowal", "email": "kris@cixar.com", "url": "https://github.com/kriskowal" }, { "name": "Irakli Gozalishvili", "email": "rfobic@gmail.com", "url": "http://jeditoolkit.com" }, { "name": "Domenic Denicola", "email": "domenic@domenicdenicola.com", "url": "http://domenicdenicola.com" } ], "dependencies": {}, "description": "A library for promises (CommonJS/Promises/A,B,D)", "devDependencies": { "cover": "*", "grunt": "~0.4.1", "grunt-cli": "~0.1.9", "grunt-contrib-uglify": "~0.9.1", "jasmine-node": "1.11.0", "jshint": "~2.1.9", "matcha": "~0.2.0", "opener": "*", "promises-aplus-tests": "1.x" }, "directories": { "test": "./spec" }, "dist": { "shasum": "7e32f75b41381291d04611f1bf14109ac00651d7", "tarball": "https://registry.npmjs.org/q/-/q-1.5.1.tgz" }, "engines": { "node": ">=0.6.0", "teleport": ">=0.2.0" }, "files": [ "LICENSE", "q.js", "queue.js" ], "gitHead": "c2f5a6f35456389a806acca50bfd929cbe30c4cb", "homepage": "https://github.com/kriskowal/q", "keywords": [ "q", "promise", "promises", "promises-a", "promises-aplus", "deferred", "future", "async", "flow control", "fluent", "browser", "node" ], "license": "MIT", "main": "q.js", "maintainers": [ { "name": "kriskowal", "email": "kris.kowal@cixar.com" }, { "name": "domenic", "email": "domenic@domenicdenicola.com" } ], "name": "q", "optionalDependencies": {}, "overlay": { "teleport": { "dependencies": { "system": ">=0.0.4" } } }, "readme": "[![Build Status](https://secure.travis-ci.org/kriskowal/q.svg?branch=master)](http://travis-ci.org/kriskowal/q)\n[![CDNJS](https://img.shields.io/cdnjs/v/q.js.svg)](https://cdnjs.com/libraries/q.js)\n\n\n \"Q\n\n\nIf a function cannot return a value or throw an exception without\nblocking, it can return a promise instead. A promise is an object\nthat represents the return value or the thrown exception that the\nfunction may eventually provide. A promise can also be used as a\nproxy for a [remote object][Q-Connection] to overcome latency.\n\n[Q-Connection]: https://github.com/kriskowal/q-connection\n\nOn the first pass, promises can mitigate the “[Pyramid of\nDoom][POD]”: the situation where code marches to the right faster\nthan it marches forward.\n\n[POD]: http://calculist.org/blog/2011/12/14/why-coroutines-wont-work-on-the-web/\n\n```javascript\nstep1(function (value1) {\n step2(value1, function(value2) {\n step3(value2, function(value3) {\n step4(value3, function(value4) {\n // Do something with value4\n });\n });\n });\n});\n```\n\nWith a promise library, you can flatten the pyramid.\n\n```javascript\nQ.fcall(promisedStep1)\n.then(promisedStep2)\n.then(promisedStep3)\n.then(promisedStep4)\n.then(function (value4) {\n // Do something with value4\n})\n.catch(function (error) {\n // Handle any error from all above steps\n})\n.done();\n```\n\nWith this approach, you also get implicit error propagation, just like `try`,\n`catch`, and `finally`. An error in `promisedStep1` will flow all the way to\nthe `catch` function, where it’s caught and handled. (Here `promisedStepN` is\na version of `stepN` that returns a promise.)\n\nThe callback approach is called an “inversion of control”.\nA function that accepts a callback instead of a return value\nis saying, “Don’t call me, I’ll call you.”. Promises\n[un-invert][IOC] the inversion, cleanly separating the input\narguments from control flow arguments. This simplifies the\nuse and creation of API’s, particularly variadic,\nrest and spread arguments.\n\n[IOC]: http://www.slideshare.net/domenicdenicola/callbacks-promises-and-coroutines-oh-my-the-evolution-of-asynchronicity-in-javascript\n\n\n## Getting Started\n\nThe Q module can be loaded as:\n\n- A ``