# superagent-promise

> superagent promise wrapper

Latest version **1.1.0** (published 2015-12-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install superagent-promise
pnpm add superagent-promise
yarn add superagent-promise
bun add superagent-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 | 1.1.0 |
| Published | 2015-12-22 |
| First published | 2014-01-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 127 |
| Author | James Lal [:lightsofapollo] |
| Maintainers | lights-of-apollo, jonasfj, gregarndt, clayreimann |
| Keywords | superagent, promise, http |

## Links

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

## 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

- 1.1.0 (latest) — 2015-12-22
- 1.0.3 — 2015-07-16
- 1.0.0 — 2015-06-03
- 0.2.0 — 2014-09-24
- 0.1.2 — 2014-07-09
- 0.1.1 — 2014-05-08
- 0.1.0 — 2014-03-07
- 0.0.0 — 2014-01-28

## README

[![Build Status](https://img.shields.io/travis/lightsofapollo/superagent-promise/master.svg)](https://travis-ci.org/lightsofapollo/superagent-promise)

superagent-promise
==================

Simple/dumb promise wrapper for superagent. You must depend on `superagent` and your favorite Promise library directly.


## Usage

```js
var Promise = this.Promise || require('promise');
var agent = require('superagent-promise')(require('superagent'), Promise);

// method, url form with `end`
agent('GET', 'http://google.com')
  .end()
  .then(function onResult(res) {
    // do stuff
  }, function onError(err) {
    //err.response has the response from the server
  });

// method, url form with `then`
agent('GET', 'http://google.com')
  .then(function onResult(res) {
    // do stuff
  });


// helper functions: options, head, get, post, put, patch, del
agent.put('http://myxfoo', 'data')
  .end()
  .then(function(res) {
    // do stuff`
  });

// helper functions: options, head, get, post, put, patch, del
agent.put('http://myxfoo', 'data').
  .then(function(res) {
    // do stuff
  });


```

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