You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <a href="http://promisesaplus.com/">
  2. <img src="https://promises-aplus.github.io/promises-spec/assets/logo-small.png" align="right" alt="Promises/A+ logo" />
  3. </a>
  4. # Request-Promise-Native
  5. [![Gitter](https://img.shields.io/badge/gitter-join_chat-blue.svg?style=flat-square&maxAge=2592000)](https://gitter.im/request/request-promise?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
  6. [![Build Status](https://img.shields.io/travis/request/request-promise-native/master.svg?style=flat-square&maxAge=2592000)](https://travis-ci.org/request/request-promise-native)
  7. [![Coverage Status](https://img.shields.io/coveralls/request/request-promise-native.svg?style=flat-square&maxAge=2592000)](https://coveralls.io/r/request/request-promise-native)
  8. [![Dependency Status](https://img.shields.io/david/request/request-promise-native.svg?style=flat-square&maxAge=2592000)](https://david-dm.org/request/request-promise-native)
  9. [![Known Vulnerabilities](https://snyk.io/test/npm/request-promise-native/badge.svg?style=flat-square&maxAge=2592000)](https://snyk.io/test/npm/request-promise-native)
  10. This package is similar to [`request-promise`](https://www.npmjs.com/package/request-promise) but uses native ES6+ promises.
  11. Please refer to the [`request-promise` documentation](https://www.npmjs.com/package/request-promise). Everything applies to `request-promise-native` except the following:
  12. - Instead of using Bluebird promises this library uses native ES6+ promises.
  13. - Native ES6+ promises may have fewer features than Bluebird promises do. In particular, the `.finally(...)` method was not included until Node v10.
  14. ## Installation
  15. This module is installed via npm:
  16. ```
  17. npm install --save request
  18. npm install --save request-promise-native
  19. ```
  20. `request` is defined as a peer-dependency and thus has to be installed separately.
  21. ## Migration from `request-promise` to `request-promise-native`
  22. 1. Go through the [migration instructions](https://github.com/request/request-promise#migration-from-v3-to-v4) to upgrade to `request-promise` v4.
  23. 2. Ensure that you don't use Bluebird-specific features on the promise returned by your request calls. In particular, you can't use `.finally(...)` anymore.
  24. 3. You are done.
  25. ## Contributing
  26. To set up your development environment:
  27. 1. clone the repo to your desktop,
  28. 2. in the shell `cd` to the main folder,
  29. 3. hit `npm install`,
  30. 4. hit `npm install gulp -g` if you haven't installed gulp globally yet, and
  31. 5. run `gulp dev`. (Or run `node ./node_modules/.bin/gulp dev` if you don't want to install gulp globally.)
  32. `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`.
  33. If 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.
  34. ## Change History
  35. - v1.0.8 (2019-11-03)
  36. - Security fix: bumped `request-promise-core` which bumps `lodash` to `^4.17.15`. See [vulnerabilty reports](https://snyk.io/vuln/search?q=lodash&type=npm).
  37. *(Thanks to @aw-davidson for reporting this in issue [#49](https://github.com/request/request-promise-native/issues/49).)*
  38. - v1.0.7 (2019-02-14)
  39. - Corrected mistakenly set `tough-cookie` version, now `^2.3.3`
  40. *(Thanks to @evocateur for pointing this out.)*
  41. - If you installed `request-promise-native@1.0.6` please make sure after the upgrade that `request` and `request-promise-native` use the same physical copy of `tough-cookie`.
  42. - v1.0.6 (2019-02-14)
  43. - Using stricter `tough-cookie@~2.3.3` to avoid installing `tough-cookie@3` which introduces breaking changes
  44. *(Thanks to @jasonmit for pull request [#33](https://github.com/request/request-promise-native/pull/33/))*
  45. - Security fix: bumped `lodash` to `^4.17.11`, see [vulnerabilty reports](https://snyk.io/vuln/search?q=lodash&type=npm)
  46. - v1.0.5 (2017-09-22)
  47. - Upgraded `tough-cookie` to a version without regex DoS vulnerability
  48. *(Thanks to @sophieklm for [pull request #13](https://github.com/request/request-promise-native/pull/13))*
  49. - v1.0.4 (2017-05-07)
  50. - Fix that allows to use `tough-cookie` for [cookie creation](https://github.com/request/request-promise#include-a-cookie)
  51. - v1.0.3 (2016-08-08)
  52. - Renamed internally used package `@request/promise-core` to `request-promise-core` because there where [too](https://github.com/request/request-promise/issues/137) [many](https://github.com/request/request-promise/issues/141) issues with the scoped package name
  53. - v1.0.2 (2016-07-18)
  54. - Fix for using with module bundlers like Webpack and Browserify
  55. - v1.0.1 (2016-07-17)
  56. - Fixed `@request/promise-core` version for safer versioning
  57. - v1.0.0 (2016-07-15)
  58. - Initial version similar to [`request-promise`](https://www.npmjs.com/package/request-promise) v4
  59. ## License (ISC)
  60. In case you never heard about the [ISC license](http://en.wikipedia.org/wiki/ISC_license) it is functionally equivalent to the MIT license.
  61. See the [LICENSE file](LICENSE) for details.