# callarest

> An http request library for node

Latest version **3.0.0** (published 2023-02-08) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2023-02-08 |
| First published | 2019-11-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 12.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Mark Wylde |
| Maintainers | markwylde |
| Keywords | rest, ajax, http, https, request, json |

## Links

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

## Dependencies (2)

- [eslint](https://npm.io/package/eslint.md) ^8.33.0
- [eslint-config-standard](https://npm.io/package/eslint-config-standard.md) ^17.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 3.0.0 (latest) — 2023-02-08
- 2.0.2 — 2020-08-02
- 2.0.1 — 2020-06-03
- 2.0.0 — 2020-03-22
- 1.6.0 — 2019-11-30
- 1.5.0 — 2019-11-26
- 1.4.0 — 2019-11-23
- 1.3.1 — 2019-11-21
- 1.3.0 — 2019-11-20
- 1.2.0 — 2019-11-20
- 1.1.0 — 2019-11-19
- 1.0.2 — 2019-11-13
- 1.0.1 — 2019-11-12
- 1.0.0 — 2019-11-12

## README

# Callarest
A simple tool to natively make http(s) requests in node

## Example Usage
### Verbose
```javascript
import { callarest } from 'callarest';

callarest({
  method: 'post',
  body: JSON.stringify({ hello: 'world' }),
  headers: {
    'Content-Type': 'application/json'
  },
  url: 'https://www.example.com'
}, function (error, rest) {
  if (error) {
    console.log('There was an error:', error);
  }
  console.log('The request was:', rest.request);
  console.log('The response was:', rest.response);
  console.log('The body was:', rest.body);

  // body will be a string
})
```

### JSON
```javascript
import { callarestJson } from 'callarest';

callarestJson({
  method: 'post',
  body: { hello: 'world' },
  url: 'https://www.example.com'
}, function (error, rest) {
  if (error) {
    console.log('There was an error:', error);
  }
  console.log('The request was:', rest.request);
  console.log('The response was:', rest.response);
  console.log('The body was:', rest.body);

  // body will be a javascript Object
})
```

## License
This project is licensed under the terms of the MIT license.

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