# request-promise-any

> The simplified HTTP request client 'request' with Promise support. Powered by 'any-promise'.

Latest version **1.0.9** (published 2020-07-22) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install request-promise-any
pnpm add request-promise-any
yarn add request-promise-any
bun add request-promise-any
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2020-07-22 |
| First published | 2016-05-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 4 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Nicolai Kamenzky |
| Maintainers | analog-nico, request |
| Keywords | xhr, http, https, promise, request, then, thenable, any, any-promise |

## Links

- npm: https://www.npmjs.com/package/request-promise-any
- Repository: https://github.com/request/request-promise-any
- Homepage: https://github.com/request/request-promise-any#readme
- Issues: https://github.com/request/request-promise-any/issues
- npm.io page: https://npm.io/package/request-promise-any

## Dependencies (4)

- [any-promise](https://npm.io/package/any-promise.md) ^1.0.0
- [tough-cookie](https://npm.io/package/tough-cookie.md) ^2.3.3
- [stealthy-require](https://npm.io/package/stealthy-require.md) ^1.1.1
- [request-promise-core](https://npm.io/package/request-promise-core.md) 1.1.4

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.0.9 (latest) — 2020-07-22
- 1.0.8 — 2019-11-04
- 1.0.7 — 2019-02-15
- 1.0.6 — 2019-02-15
- 1.0.5 — 2017-09-22
- 1.0.4 — 2017-05-08
- 1.0.3 — 2016-08-08
- 1.0.2 — 2016-07-18
- 1.0.1 — 2016-07-18
- 1.0.0 — 2016-07-16
- 0.0.0 — 2016-05-07

## README

<a href="http://promisesaplus.com/">
    <img src="https://promises-aplus.github.io/promises-spec/assets/logo-small.png" align="right" alt="Promises/A+ logo" />
</a>

# Request-Promise-Any

[![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)
[![Build Status](https://img.shields.io/travis/request/request-promise-any/master.svg?style=flat-square&maxAge=2592000)](https://travis-ci.org/request/request-promise-any)
[![Coverage Status](https://img.shields.io/coveralls/request/request-promise-any.svg?style=flat-square&maxAge=2592000)](https://coveralls.io/r/request/request-promise-any)
[![Dependency Status](https://img.shields.io/david/request/request-promise-any.svg?style=flat-square&maxAge=2592000)](https://david-dm.org/request/request-promise-any)
[![Known Vulnerabilities](https://snyk.io/test/npm/request-promise-any/badge.svg?style=flat-square&maxAge=2592000)](https://snyk.io/test/npm/request-promise-any)

# Deprecated!

As of Feb 11th 2020, [`request`](https://github.com/request/request) is fully deprecated. No new changes are expected to land. In fact, none have landed for some time. This package is also deprecated because it depends on `request`.

Fyi, here is the [reasoning of `request`'s deprecation](https://github.com/request/request/issues/3142) and a [list of alternative libraries](https://github.com/request/request/issues/3143).

---

This package is similar to [`request-promise`](https://www.npmjs.com/package/request-promise) but uses [`any-promise`](https://www.npmjs.com/package/any-promise) to let the user choose which Promise library to use.

Please refer to the [`request-promise` documentation](https://www.npmjs.com/package/request-promise). Everything applies to `request-promise-any` except the following:
- Instead of using Bluebird promises this library uses the Promise library chosen by the user.
- This library has to work with the API that all supported Promise libraries have in common. And that is the API of native ES6 promises. Mind that they have less features than Bluebird promises. In particular, the `.finally(...)` method is not available.

## Installation

This module is installed via npm:

```
npm install --save request
npm install --save request-promise-any
```

`request` is defined as a peer-dependency and thus has to be installed separately.

## Registering Your Preferred Promise Library

First, install your preferred Promise library. E.g. [Q](https://www.npmjs.com/package/q):

```
npm install --save q
```

Then, register the Promise library before you require `request-promise-any` for the first time:

``` js
require('any-promise/register/q')

var rp = require('request-promise-any')
```

For a list of supported Promise libraries and advanced registration features read the [documentation of `any-promise`](https://github.com/kevinbeaty/any-promise).

## Migration from `request-promise` to `request-promise-any`

1. Go through the [migration instructions](https://github.com/request/request-promise#migration-from-v3-to-v4) to upgrade to `request-promise` v4.
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.
3. Follow the registration instructions above.
4. You are done.

## Contributing

To set up your development environment:

1. clone the repo to your desktop,
2. in the shell `cd` to the main folder,
3. hit `npm install`,
4. hit `npm install gulp -g` if you haven't installed gulp globally yet, and
5. run `gulp dev`. (Or run `node ./node_modules/.bin/gulp dev` if you don't want to install gulp globally.)

`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`.

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.

## Change History

- v1.0.9 (2020-07-21)
    - Security fix: bumped `request-promise-core` which bumps `lodash` to `^4.17.19` following [this advisory](https://www.npmjs.com/advisories/1523).
- v1.0.8 (2019-11-03)
    - 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).
      *(Thanks to @aw-davidson for reporting this in issue [#49](https://github.com/request/request-promise-native/issues/49).)*
- v1.0.7 (2019-02-14)
    - Corrected mistakenly set `tough-cookie` version, now `^2.3.3`
      *(Thanks to @evocateur for pointing this out.)*
    - If you installed `request-promise-any@1.0.6` please make sure after the upgrade that `request` and `request-promise-any` use the same physical copy of `tough-cookie`.
- v1.0.6 (2019-02-14)
    - Using stricter `tough-cookie@~2.3.3` to avoid installing `tough-cookie@3` which introduces breaking changes
    - Security fix: bumped `lodash` to `^4.17.11`, see [vulnerabilty reports](https://snyk.io/vuln/search?q=lodash&type=npm)
- v1.0.5 (2017-09-22)
    - Upgraded `tough-cookie` to a version without regex DoS vulnerability
      *(Thanks to @rouanw and @sophieklm for their pull requests [request-promise#226](https://github.com/request/request-promise/pull/226) and [request-promise-native#13](https://github.com/request/request-promise-native/pull/13))*
- v1.0.4 (2017-05-07)
    - Fix that allows to use `tough-cookie` for [cookie creation](https://github.com/request/request-promise#include-a-cookie)
- v1.0.3 (2016-08-08)
    - 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
- v1.0.2 (2016-07-18)
    - Fix for using with module bundlers like Webpack and Browserify
- v1.0.1 (2016-07-17)
    - Fixed `@request/promise-core` version for safer versioning
- v1.0.0 (2016-07-15)
    - Initial version similar to [`request-promise`](https://www.npmjs.com/package/request-promise) v4

## License (ISC)

In case you never heard about the [ISC license](http://en.wikipedia.org/wiki/ISC_license) it is functionally equivalent to the MIT license.

See the [LICENSE file](LICENSE) for details.

---
_Source: https://npm.io/package/request-promise-any · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
