# basical-fetch

> fetch wrapper for some basical usecases

Latest version **0.0.1** (published 2017-07-02) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install basical-fetch
pnpm add basical-fetch
yarn add basical-fetch
bun add basical-fetch
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2017-07-02 |
| First published | 2017-07-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Daiki Arai |
| Maintainers | darai0512 |

## Links

- npm: https://www.npmjs.com/package/basical-fetch
- Repository: https://github.com/darai0512/easy-fetch.git#master
- Homepage: https://github.com/darai0512/easy-fetch/tree/master#readme
- Issues: https://github.com/darai0512/easy-fetch/issues
- npm.io page: https://npm.io/package/basical-fetch

## Dependencies (1)

- [querystring](https://npm.io/package/querystring.md) ^0.2.0

## Recent versions

- 0.0.1 (latest) — 2017-07-02

## README

wraps node-fetch/whatwg-fetch(/isomorphic-fetch) with adding basic headers and making query parameter string by default.

## API

- {get/post/put/delete}.{text/json}
  - param {string} url   - URL (required)
  - param {object} query - query parameter objectr (optional)
  - param {object} body  - body object (optional)
  - param {object} opt   - headers, etc (optional)
  - return {object} promise

## Example

```
// require
const nodeFetch = require('node-fetch');
const fetch = require('basical-fetch').set(nodeFetch);

// get
fetch.get.text('https://www.yahoo.co.jp').then(res => console.log(res));

// add headers
fetch.put.json('//localhost:8080', null, {body: 'here'}, {
  headers: {
    'X-HTTP-Method-Override': 'PUT',  // DELETE, PATCH
    'Content-Type' : 'text/html'
  }
});
```

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