# sadope

> Very easy to use NodeJS HTTP client

Latest version **0.2.4** (published 2023-01-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install sadope
pnpm add sadope
yarn add sadope
bun add sadope
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.4 |
| Published | 2023-01-29 |
| First published | 2022-05-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Vidar Eldøy |
| Maintainers | eldoy |

## Links

- npm: https://www.npmjs.com/package/sadope
- Repository: https://github.com/eldoy/sadope
- Homepage: https://github.com/eldoy/sadope#readme
- Issues: https://github.com/eldoy/sadope/issues
- npm.io page: https://npm.io/package/sadope

## Dependencies (1)

- [superagent](https://npm.io/package/superagent.md) ^8.0.9

## Recent versions

- 0.2.4 (latest) — 2023-01-29
- 0.2.3 — 2023-01-10
- 0.2.2 — 2023-01-10
- 0.2.1 — 2023-01-10
- 0.2.0 — 2022-12-23
- 0.1.0 — 2022-05-27

## README

# Sadope

Very easy to use NodeJS HTTP client.

Predictable API. Does not throw error on non-200 response.

### Install

```
npm i sadope
```

### Usage

```js
const request = require('sadope')

// Default options
const options = {
  method = 'get',
  params = '',
  query = '',
  fields = {},
  use = [],
  auth = '',
  headers = {},
  type = '',
  accept = ''
}
const url = 'https://api.example.com'
const response = await request(url, options)
{
  code: 200,
  data: {},
  text: '<html></html>',
  length: 13,
  type: 'text/html',
  date: 2022-12-23T13:25:10.000Z,
  connection: 'close',
  ok: true
}
```

On error the response includes an `error` object like this:
```js
{
  code: 0,
  data: {},
  text: '',
  length: 0,
  type: '',
  date: 2023-01-29T15:09:30.000Z,
  connection: '',
  headers: {},
  ok: false,
  error: {
    errno: -61,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '127.0.0.1',
    port: 54364,
    message: 'connect ECONNREFUSED 127.0.0.1:54364'
  }
}
```

ISC Licensed. Enjoy!

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