# autofetch

> fetch for node

Latest version **4.1.0** (published 2017-08-16) · MIT license · 0 weekly downloads

## Install

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

## 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 | 4.1.0 |
| Published | 2017-08-16 |
| First published | 2016-10-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | yeliex |
| Maintainers | yeliex |
| Keywords | node, ajax, fetch |

## Links

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

## Dependencies (2)

- [qs](https://npm.io/package/qs.md) ^6.3.0
- [node-fetch](https://npm.io/package/node-fetch.md) 2.0.0-alpha.3

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 4.1.0 (latest) — 2017-08-16
- 2.0.0-beta1 (beta) — 2017-04-10
- 4.0.0 — 2017-08-16
- 3.2.0 — 2017-08-14
- 3.0.6 — 2017-08-04
- 3.0.5 — 2017-07-19
- 3.0.3 — 2017-07-18
- 3.0.2 — 2017-07-18
- 3.0.1 — 2017-07-18
- 3.0.0 — 2017-07-18
- 2.2.1 — 2017-06-17
- 2.2.0 — 2017-06-14
- 2.1.1 — 2017-04-26
- 2.1.0 — 2017-04-24
- 2.0.3 — 2017-04-20
- … 44 more at https://npm.io/package/autofetch/versions

## README

# autoFetch

[![npm](https://img.shields.io/npm/v/autofetch.svg?style=flat-square)](https://www.npmjs.com/package/autofetch)

fetch api with customer auto pre actions

## Installation
```
$ npm install autoFetch
```

## Why Not `isomorphic-fetch`
- More api for node env
  - Headers.keys
  - Headers.values
- global baseHost,callback,headers,queries and url params

## Usage
```js
require('autoFetch');

fetch.baseHost('http://domain.com');

fetch('//path'); // http://domain.com/path;

fetch.baseHost((url)=>{
  return url += '/path';
})

fetch('//path'); // http://domain.com/path;

fetch('//user/:id',{ params: { id: 123 } }); // http://domain.com/user/123

fetch.callback((response)=>{
  console.log(response);
  return response;
});
````
## Contribution
PR and issue welcome

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