# @rabbotio/fetcher

> Simply fetch get/post as json

Latest version **1.6.0** (published 2020-10-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rabbotio/fetcher
pnpm add @rabbotio/fetcher
yarn add @rabbotio/fetcher
bun add @rabbotio/fetcher
```

## 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.6.0 |
| Published | 2020-10-02 |
| First published | 2017-12-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | katopz |
| Maintainers | katopz |

## Links

- npm: https://www.npmjs.com/package/@rabbotio/fetcher
- Repository: https://github.com/rabbotio/fetcher
- Homepage: https://github.com/rabbotio/fetcher#readme
- Issues: https://github.com/rabbotio/fetcher/issues
- npm.io page: https://npm.io/package/@rabbotio/fetcher

## Dependencies (1)

- [isomorphic-fetch](https://npm.io/package/isomorphic-fetch.md) ^3.0.0

## Recent versions

- 1.6.0 (latest) — 2020-10-02
- 1.5.0 — 2020-01-29
- 1.4.0 — 2019-02-04
- 1.3.0 — 2018-07-31
- 1.2.0 — 2018-07-31
- 1.1.1 — 2018-07-25
- 1.1.0 — 2018-07-20
- 1.0.5 — 2018-02-14
- 1.0.4 — 2017-12-30
- 1.0.3 — 2017-12-27
- 1.0.2 — 2017-12-27
- 1.0.1 — 2017-12-27
- 1.0.0 — 2017-12-27

## README

# fetcher
Simply fetch get/post as json

```js
import { getJSON, postJSON } from '@rabbotio/fetcher'

// get JSON
const json = await getJSON(`https://bx.in.th/api/`)
console.log(json)

// post JSON with params
const json = await postJSON(`${this.facebookURL}?access_token=${accessToken}`, {
  recipient: {
    id: recipientId
  },
  message: {
    text: messageText
  }
})
console.log(json)

// get JSON with params
const json = await getJSON(`https://bx.in.th/api/tradehistory/`, {
  pairing: 1,
  date: '2017-12-12'
})
console.log(json)

// passing headers
const json = await postJSON('https://api.line.me/v2/bot/message/reply', {
    replyToken: replyToken,
    messages: messages
  }, {
  'Authorization': `Bearer ${accessToken}`,
})
console.log(json)
```

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