{"_id":"nodegit-promise","_rev":"1813527","name":"nodegit-promise","description":"Bare bones Promises/A+ implementation with synchronous inspection","dist-tags":{"latest":"4.0.0"},"maintainers":[{"name":"johnhaley81","email":"johnhaley81@gmail.com"}],"time":{"modified":"2021-12-01T08:26:22.000Z","created":"2014-11-11T20:52:43.182Z","4.0.0":"2015-11-18T18:25:38.824Z","3.0.3":"2015-10-13T20:52:03.211Z","3.0.2":"2015-08-20T15:49:50.931Z","3.0.1":"2015-08-14T17:48:39.771Z","3.0.0":"2015-08-14T16:47:15.812Z","2.0.1":"2015-04-20T19:54:04.153Z","2.0.0":"2015-04-19T19:28:48.488Z","1.0.2":"2015-04-19T18:09:45.575Z","1.0.1":"2015-04-16T23:23:53.683Z","1.0.0":"2014-11-11T20:52:43.182Z"},"users":{},"author":{"name":"ForbesLindesay"},"repository":{"type":"git","url":"git+https://github.com/nodegit/promise.git"},"versions":{"4.0.0":{"version":"4.0.0","name":"nodegit-promise","description":"Bare bones Promises/A+ implementation with synchronous inspection","main":"index.js","scripts":{"prepublish":"node build","pretest":"node build","pretest-resolve":"node build","pretest-extensions":"node build","pretest-memory-leak":"node build","test":"mocha --bail --timeout 200 --slow 99999 -R dot && npm run test-memory-leak","test-resolve":"mocha test/resolver-tests.js --timeout 200 --slow 999999","test-extensions":"mocha test/extensions-tests.js --timeout 200 --slow 999999","test-memory-leak":"node --expose-gc test/memory-leak.js","coverage":"istanbul cover node_modules/mocha/bin/_mocha -- --bail --timeout 200 --slow 99999 -R dot"},"keywords":["promise","synchronous","inspection"],"repository":{"type":"git","url":"git+https://github.com/nodegit/promise.git"},"author":{"name":"ForbesLindesay"},"contributors":[{"name":"John Haley","email":"johnhaley81@gmail.com"},{"name":"Max Korp","email":"maxkorp@8bytealchemy.com"}],"license":"MIT","devDependencies":{"acorn":"^1.0.1","better-assert":"*","istanbul":"^0.3.13","mocha":"*","promises-aplus-tests":"*","rimraf":"^2.3.2"},"dependencies":{"asap":"~2.0.3"},"gitHead":"17a482420c03a158a48dc64601143d8057bc17b2","bugs":{"url":"https://github.com/nodegit/promise/issues"},"homepage":"https://github.com/nodegit/promise#readme","_id":"nodegit-promise@4.0.0","_shasum":"5722b184f2df7327161064a791d2e842c9167b34","_from":".","_npmVersion":"2.14.8","_nodeVersion":"0.12.7","_npmUser":{"name":"johnhaley81","email":"johnhaley81@gmail.com"},"maintainers":[{"name":"johnhaley81","email":"johnhaley81@gmail.com"}],"dist":{"shasum":"5722b184f2df7327161064a791d2e842c9167b34","size":9486,"noattachment":false,"key":"/nodegit-promise/-/nodegit-promise-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/nodegit-promise/download/nodegit-promise-4.0.0.tgz"},"directories":{},"publish_time":1447871138824,"_cnpm_publish_time":1447871138824,"_hasShrinkwrap":false},"3.0.3":{"name":"nodegit-promise","version":"3.0.3","description":"Bare bones Promises/A+ implementation with synchronous inspection","main":"index.js","scripts":{"prepublish":"node build","pretest":"node build","pretest-resolve":"node build","pretest-extensions":"node build","pretest-memory-leak":"node build","test":"mocha --bail --timeout 200 --slow 99999 -R dot && npm run test-memory-leak","test-resolve":"mocha test/resolver-tests.js --timeout 200 --slow 999999","test-extensions":"mocha test/extensions-tests.js --timeout 200 --slow 999999","test-memory-leak":"node --expose-gc test/memory-leak.js","coverage":"istanbul cover node_modules/mocha/bin/_mocha -- --bail --timeout 200 --slow 99999 -R dot"},"keywords":["promise","synchronous","inspection"],"repository":{"type":"git","url":"git+https://github.com/nodegit/promise.git"},"author":{"name":"ForbesLindesay"},"contributors":[{"name":"John Haley","email":"johnhaley81@gmail.com"},{"name":"Max Korp","email":"maxkorp@8bytealchemy.com"}],"license":"MIT","devDependencies":{"acorn":"^1.0.1","better-assert":"*","istanbul":"^0.3.13","mocha":"*","promises-aplus-tests":"*","rimraf":"^2.3.2"},"dependencies":{"asap":"~2.0.3"},"gitHead":"3b436c501c6ac74a734079a770e81695a009f1ed","bugs":{"url":"https://github.com/nodegit/promise/issues"},"homepage":"https://github.com/nodegit/promise#readme","_id":"nodegit-promise@3.0.3","_shasum":"b6c5e38b26de928a3e01e5d2cf1248f71250714c","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"johnhaley81","email":"johnhaley81@gmail.com"},"maintainers":[{"name":"johnhaley81","email":"johnhaley81@gmail.com"}],"dist":{"shasum":"b6c5e38b26de928a3e01e5d2cf1248f71250714c","size":9171,"noattachment":false,"key":"/nodegit-promise/-/nodegit-promise-3.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/nodegit-promise/download/nodegit-promise-3.0.3.tgz"},"directories":{},"publish_time":1444769523211,"_cnpm_publish_time":1444769523211,"_hasShrinkwrap":false},"3.0.2":{"name":"nodegit-promise","version":"3.0.2","description":"Bare bones Promises/A+ implementation with synchronous inspection","main":"index.js","scripts":{"prepublish":"node build","pretest":"node build","pretest-resolve":"node build","pretest-extensions":"node build","pretest-memory-leak":"node build","test":"mocha --bail --timeout 200 --slow 99999 -R dot && npm run test-memory-leak","test-resolve":"mocha test/resolver-tests.js --timeout 200 --slow 999999","test-extensions":"mocha test/extensions-tests.js --timeout 200 --slow 999999","test-memory-leak":"node --expose-gc test/memory-leak.js","coverage":"istanbul cover node_modules/mocha/bin/_mocha -- --bail --timeout 200 --slow 99999 -R dot"},"keywords":["promise","synchronous","inspection"],"repository":{"type":"git","url":"https://github.com/nodegit/promise.git"},"author":{"name":"ForbesLindesay"},"contributors":[{"name":"John Haley","email":"johnhaley81@gmail.com"},{"name":"Max Korp","email":"maxkorp@8bytealchemy.com"}],"license":"MIT","devDependencies":{"acorn":"^1.0.1","better-assert":"*","istanbul":"^0.3.13","mocha":"*","promises-aplus-tests":"*","rimraf":"^2.3.2"},"dependencies":{"asap":"~2.0.3"},"gitHead":"dbb0dd8007c02274787424ac31c9f532914683af","bugs":{"url":"https://github.com/nodegit/promise/issues"},"homepage":"https://github.com/nodegit/promise","_id":"nodegit-promise@3.0.2","_shasum":"d34c5d522c0fb888334d8a50f66ca4587377dfe4","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"johnhaley81","email":"john@haley.io"},"maintainers":[{"name":"johnhaley81","email":"johnhaley81@gmail.com"}],"dist":{"shasum":"d34c5d522c0fb888334d8a50f66ca4587377dfe4","size":9116,"noattachment":false,"key":"/nodegit-promise/-/nodegit-promise-3.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/nodegit-promise/download/nodegit-promise-3.0.2.tgz"},"directories":{},"publish_time":1440085790931,"_cnpm_publish_time":1440085790931,"_hasShrinkwrap":false},"3.0.1":{"name":"nodegit-promise","version":"3.0.1","description":"Bare bones Promises/A+ implementation with synchronous inspection","main":"index.js","scripts":{"prepublish":"node build","pretest":"node build","pretest-resolve":"node build","pretest-extensions":"node build","pretest-memory-leak":"node build","test":"mocha --bail --timeout 200 --slow 99999 -R dot && npm run test-memory-leak","test-resolve":"mocha test/resolver-tests.js --timeout 200 --slow 999999","test-extensions":"mocha test/extensions-tests.js --timeout 200 --slow 999999","test-memory-leak":"node --expose-gc test/memory-leak.js","coverage":"istanbul cover node_modules/mocha/bin/_mocha -- --bail --timeout 200 --slow 99999 -R dot"},"keywords":["promise","synchronous","inspection"],"repository":{"type":"git","url":"https://github.com/nodegit/promise.git"},"author":{"name":"ForbesLindesay"},"contributors":[{"name":"John Haley","email":"johnhaley81@gmail.com"},{"name":"Max Korp","email":"maxkorp@8bytealchemy.com"}],"license":"MIT","devDependencies":{"acorn":"^1.0.1","better-assert":"*","istanbul":"^0.3.13","mocha":"*","promises-aplus-tests":"*","rimraf":"^2.3.2"},"dependencies":{"asap":"~2.0.3"},"gitHead":"61dcab0395f05265dd9a65455bb2168f31da9064","bugs":{"url":"https://github.com/nodegit/promise/issues"},"homepage":"https://github.com/nodegit/promise","_id":"nodegit-promise@3.0.1","_shasum":"f1f56982e1c625df49ff2443080161f1582532a7","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"johnhaley81","email":"john@haley.io"},"maintainers":[{"name":"johnhaley81","email":"johnhaley81@gmail.com"}],"dist":{"shasum":"f1f56982e1c625df49ff2443080161f1582532a7","size":9145,"noattachment":false,"key":"/nodegit-promise/-/nodegit-promise-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/nodegit-promise/download/nodegit-promise-3.0.1.tgz"},"directories":{},"publish_time":1439574519771,"_cnpm_publish_time":1439574519771,"_hasShrinkwrap":false},"3.0.0":{"name":"nodegit-promise","version":"3.0.0","description":"Bare bones Promises/A+ implementation with synchronous inspection","main":"index.js","scripts":{"prepublish":"node build","pretest":"node build","pretest-resolve":"node build","pretest-extensions":"node build","pretest-memory-leak":"node build","test":"mocha --bail --timeout 200 --slow 99999 -R dot && npm run test-memory-leak","test-resolve":"mocha test/resolver-tests.js --timeout 200 --slow 999999","test-extensions":"mocha test/extensions-tests.js --timeout 200 --slow 999999","test-memory-leak":"node --expose-gc test/memory-leak.js","coverage":"istanbul cover node_modules/mocha/bin/_mocha -- --bail --timeout 200 --slow 99999 -R dot"},"keywords":["promise","synchronous","inspection"],"repository":{"type":"git","url":"https://github.com/nodegit/promise.git"},"author":{"name":"ForbesLindesay"},"contributors":[{"name":"John Haley","email":"johnhaley81@gmail.com"},{"name":"Max Korp","email":"maxkorp@8bytealchemy.com"}],"license":"MIT","devDependencies":{"acorn":"^1.0.1","better-assert":"*","istanbul":"^0.3.13","mocha":"*","promises-aplus-tests":"*","rimraf":"^2.3.2"},"dependencies":{"asap":"~2.0.3"},"gitHead":"ad481c7f1f4da6902752410abccff6014fe03fe2","bugs":{"url":"https://github.com/nodegit/promise/issues"},"homepage":"https://github.com/nodegit/promise","_id":"nodegit-promise@3.0.0","_shasum":"6d602d09ae0d68a2e83e093f622248d25e3a7b2c","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"johnhaley81","email":"john@haley.io"},"maintainers":[{"name":"johnhaley81","email":"johnhaley81@gmail.com"}],"dist":{"shasum":"6d602d09ae0d68a2e83e093f622248d25e3a7b2c","size":9121,"noattachment":false,"key":"/nodegit-promise/-/nodegit-promise-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/nodegit-promise/download/nodegit-promise-3.0.0.tgz"},"directories":{},"publish_time":1439570835812,"_cnpm_publish_time":1439570835812,"_hasShrinkwrap":false},"2.0.1":{"name":"nodegit-promise","version":"2.0.1","description":"Bare bones Promises/A+ implementation with synchronous inspection","main":"index.js","scripts":{"prepublish":"node build","pretest":"node build","pretest-resolve":"node build","pretest-extensions":"node build","pretest-memory-leak":"node build","test":"mocha --bail --timeout 200 --slow 99999 -R dot && npm run test-memory-leak","test-resolve":"mocha test/resolver-tests.js --timeout 200 --slow 999999","test-extensions":"mocha test/extensions-tests.js --timeout 200 --slow 999999","test-memory-leak":"node --expose-gc test/memory-leak.js"},"keywords":["promise","synchronous","inspection"],"repository":{"type":"git","url":"https://github.com/nodegit/promise.git"},"author":{"name":"ForbesLindesay"},"contributors":[{"name":"John Haley","email":"johnhaley81@gmail.com"}],"license":"MIT","devDependencies":{"acorn":"^1.0.1","better-assert":"*","mocha":"*","promises-aplus-tests":"*","rimraf":"^2.3.2"},"dependencies":{"asap":"~2.0.1"},"gitHead":"faeed88fc274accc812d757ac14527f18b818874","bugs":{"url":"https://github.com/nodegit/promise/issues"},"homepage":"https://github.com/nodegit/promise","_id":"nodegit-promise@2.0.1","_shasum":"356637c9a1501f367618d3e72364ceb95e8ad3ee","_from":".","_npmVersion":"2.4.1","_nodeVersion":"0.10.36","_npmUser":{"name":"johnhaley81","email":"johnhaley81@gmail.com"},"maintainers":[{"name":"johnhaley81","email":"johnhaley81@gmail.com"}],"dist":{"shasum":"356637c9a1501f367618d3e72364ceb95e8ad3ee","size":8849,"noattachment":false,"key":"/nodegit-promise/-/nodegit-promise-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/nodegit-promise/download/nodegit-promise-2.0.1.tgz"},"directories":{},"publish_time":1429559644153,"_cnpm_publish_time":1429559644153,"_hasShrinkwrap":false},"2.0.0":{"name":"nodegit-promise","version":"2.0.0","description":"Bare bones Promises/A+ implementation with synchronous inspection","main":"index.js","scripts":{"prepublish":"node build","pretest":"node build","pretest-resolve":"node build","pretest-extensions":"node build","pretest-memory-leak":"node build","test":"mocha --bail --timeout 200 --slow 99999 -R dot && npm run test-memory-leak","test-resolve":"mocha test/resolver-tests.js --timeout 200 --slow 999999","test-extensions":"mocha test/extensions-tests.js --timeout 200 --slow 999999","test-memory-leak":"node --expose-gc test/memory-leak.js"},"keywords":["promise","synchronous","inspection"],"repository":{"type":"git","url":"https://github.com/nodegit/promise.git"},"author":{"name":"ForbesLindesay"},"contributors":[{"name":"John Haley","email":"johnhaley81@gmail.com"}],"license":"MIT","devDependencies":{"acorn":"^1.0.1","better-assert":"*","mocha":"*","promises-aplus-tests":"*","rimraf":"^2.3.2"},"dependencies":{"asap":"~2.0.1"},"gitHead":"0729d3a78046e2d394647f018018244fb2992c78","bugs":{"url":"https://github.com/nodegit/promise/issues"},"homepage":"https://github.com/nodegit/promise","_id":"nodegit-promise@2.0.0","_shasum":"ff560739a7d59df51b583379b86a4afbb0274176","_from":".","_npmVersion":"2.4.1","_nodeVersion":"0.10.36","_npmUser":{"name":"johnhaley81","email":"johnhaley81@gmail.com"},"maintainers":[{"name":"johnhaley81","email":"johnhaley81@gmail.com"}],"dist":{"shasum":"ff560739a7d59df51b583379b86a4afbb0274176","size":8851,"noattachment":false,"key":"/nodegit-promise/-/nodegit-promise-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/nodegit-promise/download/nodegit-promise-2.0.0.tgz"},"directories":{},"publish_time":1429471728488,"_cnpm_publish_time":1429471728488,"_hasShrinkwrap":false},"1.0.2":{"name":"nodegit-promise","version":"1.0.2","description":"Bare bones Promises/A+ implementation with synchronous inspection","main":"index.js","scripts":{"test":"mocha --timeout 200 --slow 99999","test-resolve":"mocha test/resolver-tests.js -R spec --timeout 200 --slow 999999","test-extensions":"mocha test/extensions-tests.js -R spec --timeout 200 --slow 999999"},"keywords":["promise","synchronous","inspection"],"repository":{"type":"git","url":"https://github.com/nodegit/promise.git"},"author":{"name":"ForbesLindesay"},"contributors":[{"name":"John Haley","email":"johnhaley81@gmail.com"}],"license":"MIT","devDependencies":{"promises-aplus-tests":"*","better-assert":"*","mocha":"*"},"dependencies":{"asap":"~1.0.0"},"gitHead":"07f5b9d9c3e708c3cc42851281ea5e5c36ab4e31","bugs":{"url":"https://github.com/nodegit/promise/issues"},"homepage":"https://github.com/nodegit/promise","_id":"nodegit-promise@1.0.2","_shasum":"90c067cc6e8dc0ba4f854e40d17773f0ea2c7447","_from":".","_npmVersion":"2.4.1","_nodeVersion":"0.10.36","_npmUser":{"name":"johnhaley81","email":"johnhaley81@gmail.com"},"maintainers":[{"name":"johnhaley81","email":"johnhaley81@gmail.com"}],"dist":{"shasum":"90c067cc6e8dc0ba4f854e40d17773f0ea2c7447","size":6718,"noattachment":false,"key":"/nodegit-promise/-/nodegit-promise-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/nodegit-promise/download/nodegit-promise-1.0.2.tgz"},"directories":{},"publish_time":1429466985575,"_cnpm_publish_time":1429466985575,"_hasShrinkwrap":false},"1.0.1":{"name":"nodegit-promise","version":"1.0.1","description":"Bare bones Promises/A+ implementation with synchronous inspection","main":"index.js","scripts":{"test":"mocha --timeout 200 --slow 99999","test-resolve":"mocha test/resolver-tests.js -R spec --timeout 200 --slow 999999","test-extensions":"mocha test/extensions-tests.js -R spec --timeout 200 --slow 999999"},"keywords":["promise","synchronous","inspection"],"repository":{"type":"git","url":"https://github.com/nodegit/promise.git"},"author":{"name":"ForbesLindesay"},"contributors":[{"name":"John Haley","email":"johnhaley81@gmail.com"}],"license":"MIT","devDependencies":{"promises-aplus-tests":"*","better-assert":"*","mocha":"*"},"dependencies":{"asap":"~1.0.0"},"gitHead":"ffdc9cd8f71dd9b444e5a8e2999bc728ff92849a","bugs":{"url":"https://github.com/nodegit/promise/issues"},"homepage":"https://github.com/nodegit/promise","_id":"nodegit-promise@1.0.1","_shasum":"bab4f8a365d1bf3dd0c0a8f767a662dca939bb61","_from":".","_npmVersion":"2.4.1","_nodeVersion":"0.10.36","_npmUser":{"name":"johnhaley81","email":"johnhaley81@gmail.com"},"maintainers":[{"name":"johnhaley81","email":"johnhaley81@gmail.com"}],"dist":{"shasum":"bab4f8a365d1bf3dd0c0a8f767a662dca939bb61","size":6709,"noattachment":false,"key":"/nodegit-promise/-/nodegit-promise-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/nodegit-promise/download/nodegit-promise-1.0.1.tgz"},"directories":{},"publish_time":1429226633683,"_cnpm_publish_time":1429226633683,"_hasShrinkwrap":false},"1.0.0":{"name":"nodegit-promise","version":"1.0.0","description":"Bare bones Promises/A+ implementation with synchronous inspection","main":"index.js","scripts":{"test":"mocha --timeout 200 --slow 99999","test-resolve":"mocha test/resolver-tests.js -R spec --timeout 200 --slow 999999","test-extensions":"mocha test/extensions-tests.js -R spec --timeout 200 --slow 999999"},"keywords":["promise","synchronous","inspection"],"repository":{"type":"git","url":"https://github.com/nodegit/promise.git"},"author":{"name":"ForbesLindesay"},"contributors":[{"name":"John Haley","email":"johnhaley81@gmail.com"}],"license":"MIT","devDependencies":{"promises-aplus-tests":"*","better-assert":"*","mocha":"*"},"dependencies":{"asap":"~1.0.0"},"gitHead":"2f878cd74ad64bca1b8a8061585ea6f7202848d1","bugs":{"url":"https://github.com/nodegit/promise/issues"},"homepage":"https://github.com/nodegit/promise","_id":"nodegit-promise@1.0.0","_shasum":"1540bc2a2d8a6503e14da744f9c025573b564af8","_from":".","_npmVersion":"2.1.7","_nodeVersion":"0.10.33","_npmUser":{"name":"johnhaley81","email":"johnhaley81@gmail.com"},"maintainers":[{"name":"johnhaley81","email":"johnhaley81@gmail.com"}],"dist":{"shasum":"1540bc2a2d8a6503e14da744f9c025573b564af8","size":6728,"noattachment":false,"key":"/nodegit-promise/-/nodegit-promise-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/nodegit-promise/download/nodegit-promise-1.0.0.tgz"},"directories":{},"publish_time":1415739163182,"_cnpm_publish_time":1415739163182,"_hasShrinkwrap":false}},"readme":"<a href=\"https://promisesaplus.com/\"><img src=\"https://promisesaplus.com/assets/logo-small.png\" align=\"right\" /></a>\n# promise\n\nThis is a simple implementation of Promises.  It is a super set of ES6 Promises designed to have readable, performant code and to provide just the extensions that are absolutely necessary for using promises today.\n\nFor detailed tutorials on its use, see www.promisejs.org\n\n**N.B.** This promise exposes internals via underscore (`_`) prefixed properties.  If you use these, your code will break with each new release.\n\n[![travis][travis-image]][travis-url]\n[![dep][dep-image]][dep-url]\n[![npm][npm-image]][npm-url]\n[![downloads][downloads-image]][downloads-url]\n\n[travis-image]: https://img.shields.io/travis/then/promise.svg?style=flat\n[travis-url]: https://travis-ci.org/then/promise\n[dep-image]: https://img.shields.io/gemnasium/then/promise.svg?style=flat\n[dep-url]: https://gemnasium.com/then/promise\n[npm-image]: https://img.shields.io/npm/v/promise.svg?style=flat\n[npm-url]: https://npmjs.org/package/promise\n[downloads-image]: https://img.shields.io/npm/dm/promise.svg?style=flat\n[downloads-url]: https://npmjs.org/package/promise\n\n## Installation\n\n**Server:**\n\n    $ npm install promise\n\n**Client:**\n\nYou can use browserify on the client, or use the pre-compiled script that acts as a polyfill.\n\n```html\n<script src=\"https://www.promisejs.org/polyfills/promise-6.1.0.js\"></script>\n```\n\nNote that the [es5-shim](https://github.com/es-shims/es5-shim) must be loaded before this library to support browsers pre IE9.\n\n```html\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/es5-shim/3.4.0/es5-shim.min.js\"></script>\n```\n\n## Usage\n\nThe example below shows how you can load the promise library (in a way that works on both client and server using node or browserify).  It then demonstrates creating a promise from scratch.  You simply call `new Promise(fn)`.  There is a complete specification for what is returned by this method in [Promises/A+](http://promises-aplus.github.com/promises-spec/).\n\n```javascript\nvar Promise = require('promise');\n\nvar promise = new Promise(function (resolve, reject) {\n  get('http://www.google.com', function (err, res) {\n    if (err) reject(err);\n    else resolve(res);\n  });\n});\n```\n\nIf you need [domains](https://iojs.org/api/domain.html) support, you should instead use:\n\n```js\nvar Promise = require('promise/domains');\n```\n\nIf you are in an environment that implements `setImmediate` and don't want the optimisations provided by asap, you can use:\n\n```js\nvar Promise = require('promise/setimmediate');\n```\n\nIf you only want part of the features, e.g. just a pure ES6 polyfill:\n\n```js\nvar Promise = require('promise/lib/es6-extensions');\n// or require('promise/domains/es6-extensions');\n// or require('promise/setimmediate/es6-extensions');\n```\n\n## API\n\nBefore all examples, you will need:\n\n```js\nvar Promise = require('promise');\n```\n\n### new Promise(resolver)\n\nThis creates and returns a new promise.  `resolver` must be a function.  The `resolver` function is passed two arguments:\n\n 1. `resolve` should be called with a single argument.  If it is called with a non-promise value then the promise is fulfilled with that value.  If it is called with a promise (A) then the returned promise takes on the state of that new promise (A).\n 2. `reject` should be called with a single argument.  The returned promise will be rejected with that argument.\n\n### Static Functions\n\n  These methods are invoked by calling `Promise.methodName`.\n\n#### Promise.resolve(value)\n\n(deprecated aliases: `Promise.from(value)`, `Promise.cast(value)`)\n\nConverts values and foreign promises into Promises/A+ promises.  If you pass it a value then it returns a Promise for that value.  If you pass it something that is close to a promise (such as a jQuery attempt at a promise) it returns a Promise that takes on the state of `value` (rejected or fulfilled).\n\n#### Promise.reject(value)\n\nReturns a rejected promise with the given value.\n\n#### Promise.all(array)\n\nReturns a promise for an array.  If it is called with a single argument that `Array.isArray` then this returns a promise for a copy of that array with any promises replaced by their fulfilled values.  e.g.\n\n```js\nPromise.all([Promise.resolve('a'), 'b', Promise.resolve('c')])\n  .then(function (res) {\n    assert(res[0] === 'a')\n    assert(res[1] === 'b')\n    assert(res[2] === 'c')\n  })\n```\n\n#### Promise.denodeify(fn)\n\n_Non Standard_\n\nTakes a function which accepts a node style callback and returns a new function that returns a promise instead.\n\ne.g.\n\n```javascript\nvar fs = require('fs')\n\nvar read = Promise.denodeify(fs.readFile)\nvar write = Promise.denodeify(fs.writeFile)\n\nvar p = read('foo.json', 'utf8')\n  .then(function (str) {\n    return write('foo.json', JSON.stringify(JSON.parse(str), null, '  '), 'utf8')\n  })\n```\n\n#### Promise.nodeify(fn)\n\n_Non Standard_\n\nThe twin to `denodeify` is useful when you want to export an API that can be used by people who haven't learnt about the brilliance of promises yet.\n\n```javascript\nmodule.exports = Promise.nodeify(awesomeAPI)\nfunction awesomeAPI(a, b) {\n  return download(a, b)\n}\n```\n\nIf the last argument passed to `module.exports` is a function, then it will be treated like a node.js callback and not parsed on to the child function, otherwise the API will just return a promise.\n\n### Prototype Methods\n\nThese methods are invoked on a promise instance by calling `myPromise.methodName`\n\n### Promise#then(onFulfilled, onRejected)\n\nThis method follows the [Promises/A+ spec](http://promises-aplus.github.io/promises-spec/).  It explains things very clearly so I recommend you read it.\n\nEither `onFulfilled` or `onRejected` will be called and they will not be called more than once.  They will be passed a single argument and will always be called asynchronously (in the next turn of the event loop).\n\nIf the promise is fulfilled then `onFulfilled` is called.  If the promise is rejected then `onRejected` is called.\n\nThe call to `.then` also returns a promise.  If the handler that is called returns a promise, the promise returned by `.then` takes on the state of that returned promise.  If the handler that is called returns a value that is not a promise, the promise returned by `.then` will be fulfilled with that value. If the handler that is called throws an exception then the promise returned by `.then` is rejected with that exception.\n\n#### Promise#catch(onRejected)\n\nSugar for `Promise#then(null, onRejected)`, to mirror `catch` in synchronous code.\n\n#### Promise#done(onFulfilled, onRejected)\n\n_Non Standard_\n\nThe same semantics as `.then` except that it does not return a promise and any exceptions are re-thrown so that they can be logged (crashing the application in non-browser environments)\n\n#### Promise#nodeify(callback)\n\n_Non Standard_\n\nIf `callback` is `null` or `undefined` it just returns `this`.  If `callback` is a function it is called with rejection reason as the first argument and result as the second argument (as per the node.js convention).\n\nThis lets you write API functions that look like:\n\n```javascript\nfunction awesomeAPI(foo, bar, callback) {\n  return internalAPI(foo, bar)\n    .then(parseResult)\n    .then(null, retryErrors)\n    .nodeify(callback)\n}\n```\n\nPeople who use typical node.js style callbacks will be able to just pass a callback and get the expected behavior.  The enlightened people can not pass a callback and will get awesome promises.\n\n## License\n\n  MIT\n","_attachments":{},"homepage":"https://github.com/nodegit/promise#readme","bugs":{"url":"https://github.com/nodegit/promise/issues"},"license":"MIT"}