{"name":"@request/promise-core","version":"0.0.1","description":"Core Promise support implementation for the simplified HTTP request client 'request'.","keywords":["xhr","http","https","promise","request","then","thenable","native"],"main":"./lib/rp.js","scripts":{"test":"gulp ci"},"repository":{"type":"git","url":"git+https://github.com/request/promise-core.git"},"author":{"name":"Nicolai Kamenzky","url":"https://github.com/analog-nico"},"license":"ISC","bugs":{"url":"https://github.com/request/promise-core/issues"},"homepage":"https://github.com/request/promise-core#readme","engines":{"node":">=0.10.0"},"gitHead":"07b982ad397706fc04676a849cbd750ae7cf55b1","_id":"@request/promise-core@0.0.1","_shasum":"a8751f81589bc23caa874e9bee1df838b9aac51a","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.1.0","_npmUser":{"name":"analog-nico","email":"nicolai.kamenzky@testrails.org"},"maintainers":[{"name":"request","email":"request@outofindex.com"}],"dist":{"shasum":"a8751f81589bc23caa874e9bee1df838b9aac51a","tarball":"http://registry-npm.ywwl.com/@request/promise-core/download/@request/promise-core-0.0.1.tgz","integrity":"sha512-lQ+V+kOXTaeEimYKxHZB/lJKW98RZqCwRh6nMmDApRq/2h3wGi9KePa6dAWQR1uUJvKiJttx3zkUrSGNfMT08A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB5MIf2iHATd+6bhocv1QpindE4iMQGt7fvnR1a2XV2aAiEAjDHxsI49tOCdOO66/O76ibnmkAF/ptcG7CQHFinrLzg="}],"size":1305,"noattachment":false,"key":"/@request/promise-core/-/@request/promise-core-0.0.1.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/promise-core-0.0.1.tgz_1462604848763_0.14493800746276975"},"deprecated":"This package got renamed. Please install request-promise-core instead.","directories":{},"readme":"<a href=\"http://promisesaplus.com/\">\n    <img src=\"https://promises-aplus.github.io/promises-spec/assets/logo-small.png\" align=\"right\" alt=\"Promises/A+ logo\" />\n</a>\n\n# @request/promise-core\n\n[![Gitter](https://img.shields.io/badge/gitter-join_chat-blue.svg?style=flat-square)](https://gitter.im/request/request-promise?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n[![Build Status](https://img.shields.io/travis/request/promise-core/master.svg?style=flat-square)](https://travis-ci.org/request/promise-core)\n[![Coverage Status](https://img.shields.io/coveralls/request/promise-core.svg?style=flat-square)](https://coveralls.io/r/request/promise-core)\n[![Dependency Status](https://img.shields.io/gemnasium/request/promise-core.svg?style=flat-square)](https://gemnasium.com/github.com/request/promise-core)\n[![Known Vulnerabilities](https://snyk.io/test/npm/promise-core/badge.svg?style=flat-square)](https://snyk.io/test/npm/promise-core)\n\n\nThis package is the core for the following packages:\n\n- [`request-promise`](https://github.com/request/request-promise)\n- [`request-promise-any`](https://github.com/request/request-promise-any)\n- [`request-promise-bluebird`](https://github.com/request/request-promise-bluebird)\n- [`request-promise-native`](https://github.com/request/request-promise-native)\n\n`@request/promise-core` contains the core logic to add Promise support to [`request`](https://github.com/request/request).\n\nPlease use one of the libraries above. It is only recommended to use this library directly, if you have very specific requirements.\n\n## Installation for `request@^2.34`\n\nThis module is installed via npm:\n\n```\nnpm install --save request\nnpm install --save @request/promise-core\n```\n\n`request` is defined as a peer-dependency and thus has to be installed separately.\n\n## Usage for `request@^2.34`\n\n``` js\n// 1. Load the request library\n\n// Only use a direct require if you are 100% sure that:\n// - Your project does not use request directly. That is without the Promise capabilities by calling require('request').\n// - Any of the installed libraries use request.\n// ...because Request's prototype will be patched in step 2.\n/* var request = require('request'); */\n\n// Instead use:\nvar stealthyRequire = require('stealthy-require');\nvar request = stealthyRequire(require.cache, function () {\n    return require('request');\n});\n\n\n// 2. Add Promise support to request\n\nvar configure = require('@request/promise-core/configure/request2');\n\nconfigure({\n    request: request,\n\t// Pass your favorite ES6-compatible promise implementation\n    PromiseImpl: Promise,\n\t// Expose all methods of the promise instance you want to call on the request(...) call\n    expose: [\n        'then',   // Allows to use request(...).then(...)\n        'catch',  // Allows to use request(...).catch(...)\n        'promise' // Allows to use request(...).promise() which returns the promise instance\n    ],\n    // Optional: Pass a callback that is called within the Promise constructor\n    constructorMixin: function (resolve, reject) {\n        // `this` is the request object\n        // Additional arguments may be passed depending on the PromiseImpl used\n    }\n});\n\n\n// 3. Use request with its promise capabilities\n\n// E.g. crawl a web page:\nrequest('http://www.google.com')\n    .then(function (htmlString) {\n        // Process html...\n    })\n    .catch(function (err) {\n        // Crawling failed...\n    });\n```\n\n## Installation and Usage for `request@next`\n\n[Request Next](https://github.com/request/request/issues/1982) is still in alpha. However, `@request/promise-core` is already designed to be compatible and ships with a configuration helper – `require('@request/promise-core/configure/request-next')` – that is [used by `request-promise`](https://github.com/request/request-promise/blob/next/lib/rp.js) in its \"next\" branch.\n\n## Contributing\n\nTo set up your development environment:\n\n1. clone the repo to your desktop,\n2. in the shell `cd` to the main folder,\n3. hit `npm install`,\n4. hit `npm install gulp -g` if you haven't installed gulp globally yet, and\n5. run `gulp dev`. (Or run `node ./node_modules/.bin/gulp dev` if you don't want to install gulp globally.)\n\n`gulp dev` watches all source files and if you save some changes it will lint the code and execute all tests. The test coverage report can be viewed from `./coverage/lcov-report/index.html`.\n\nIf you want to debug a test you should use `gulp test-without-coverage` to run all tests without obscuring the code by the test coverage instrumentation.\n\n## Change History\n\n- 1.1.0 (2016-07-30)\n    - Added `constructorMixin` option to enable [request/request-promise#123](https://github.com/request/request-promise/pull/123)\n- 1.0.0 (2016-07-15)\n    - All tests green, ready for prime time\n- 1.0.0-rc.1 (2016-07-10)\n    - Reimplementation of core logic based on `request-promise@3.0.0`\n    - Plus `transform2xxOnly` option (fixes [request/request-promise#131](https://github.com/request/request-promise/issues/131))\n\n## License (ISC)\n\nIn case you never heard about the [ISC license](http://en.wikipedia.org/wiki/ISC_license) it is functionally equivalent to the MIT license.\n\nSee the [LICENSE file](LICENSE) for details.","publish_time":1462604849179,"_cnpm_publish_time":1462604849179,"dist-tags":{"latest":"1.1.0"}}