# @eccenca/superagent

> Extended version of superagent.js, pimped with RX, better Link header parsing and HTTP Problem support

Latest version **1.4.1** (published 2018-05-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @eccenca/superagent
pnpm add @eccenca/superagent
yarn add @eccenca/superagent
bun add @eccenca/superagent
```

## 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.4.1 |
| Published | 2018-05-09 |
| First published | 2018-01-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 21.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | eccenca GmbH |
| Maintainers | eccenca-admin, jorgemartinezpizarro, kvollers, supellex |

## Links

- npm: https://www.npmjs.com/package/@eccenca/superagent
- Repository: https://github.com/eccenca/ecc-superagent
- Issues: https://github.com/eccenca/ecc-superagent/issues
- npm.io page: https://npm.io/package/@eccenca/superagent

## Dependencies (4)

- [lodash](https://npm.io/package/lodash.md) ^4.13.1
- [methods](https://npm.io/package/methods.md) ^1.1.2
- [warning](https://npm.io/package/warning.md) ^3.0.0
- [superagent](https://npm.io/package/superagent.md) ^3.8.2

## Recent versions

- 1.4.1 (latest) — 2018-05-09
- 2.0.1 — 2018-04-09
- 2.0.1-beta.2 — 2018-04-09
- 2.0.1-beta.1 — 2018-04-09
- 2.0.1-alpha.1 — 2018-04-04
- 2.0.0-alpha.1 — 2018-04-04
- 2.0.0 — 2018-02-08
- 1.4.0 — 2018-01-23

## README

# Eccenca extended Superagent lib (ecc-superagent)

Extended version of Superagent.js to use within eLDS framework

## Usage

Includes [Superagent.js](https://github.com/visionmedia/superagent) and [Superagent-rx](https://github.com/yamalight/superagent-rx) packages.
So, all you need to use it is import and call with your ajax requests:

```js
import request from 'ecc-superagent';
// ...
// parse results
request
    .get(requestUrl)
    .observe() // this returns Rx.Observable
    .subscribe(function(res) {
        // use res
    });
// use results ...
```

Futhermore it is possible to register/unregister global superagent plugins to manipulate each request.
For Example:

```
import request from 'ecc-superagent';

// Register a plugin which sets a header on each request
request.useForEachRequest('setHeaderPlugin', (request) => {
    request.set('X-Example-Header', 'FOO');
    return request;
});

// The following request will have the X-Example-Header set
request
    .get('http://example.org')
    .observe() // this returns Rx.Observable
    .subscribe(function(res) {
        // use res
    });

// Disable the plugin
request.useForEachRequest('setHeaderPlugin', false);

```

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