# node-rest-client-promise

> node-rest-client, but with promises

Latest version **3.1.1** (published 2018-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-rest-client-promise
pnpm add node-rest-client-promise
yarn add node-rest-client-promise
bun add node-rest-client-promise
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.1 |
| Published | 2018-07-20 |
| First published | 2017-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 31.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Dennis Ploeger |
| Maintainers | dodevops |
| Keywords | rest, node-rest-client, promises |

## Links

- npm: https://www.npmjs.com/package/node-rest-client-promise
- Repository: https://github.com/dodevops/node-rest-client-promise
- Homepage: https://github.com/dodevops/node-rest-client-promise#readme
- Issues: https://github.com/dodevops/node-rest-client-promise/issues
- npm.io page: https://npm.io/package/node-rest-client-promise

## Dependencies (2)

- [bluebird](https://npm.io/package/bluebird.md) ^3.4.7
- [node-rest-client](https://npm.io/package/node-rest-client.md) ^3.1.0

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 3.1.1 (latest) — 2018-07-20
- 3.1.0 — 2018-02-19
- 3.0.0 — 2017-08-28
- 2.0.0 — 2017-03-06
- 1.0.1 — 2017-02-10
- 1.0.0 — 2017-02-09

## README

# node-rest-client-promise

[![Travis](https://img.shields.io/travis/dodevops/node-rest-client-promise.svg)](https://travis-ci.org/dodevops/node-rest-client-promise)

node-rest-client, but with promises

## Introduction

I found this question and answer on StackOverflow about promisifying
the node-rest-client module:

http://stackoverflow.com/questions/30112657/how-to-use-bluebird-to-promisify-node-rest-client

However, it seems the original author didn't share a node module
for this, so I did that. Additionally, I had to fix a few small things
and document it.

This module provides a promisifed version of the
[node-rest-client](https://www.npmjs.com/package/node-rest-client).

## Usage

This module provides this small function:
  * client(options): Call `new Client(options)`, promisify and return it

The promisified client methods will have a "Promise" suffix:

```javascript
var client = require('node-rest-client-promise').Client(options);

client.getPromise(url).catch(...).then(...)
```

Please note, that the resolved callback of the Promise will be called
with one argument to comply with Promise style. This argument will
be an object with the keys 'data' and 'response' reflecting the original
arguments of e.g. `client.get()`.

For details about node-rest-client, please see the
[original documentation](https://www.npmjs.com/package/node-rest-client)

## Usage of registerMethod

Node Rest Client's method "registerMethod" is available as registerMethodPromise from Version 3.1.0 on.

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