# @liter/common-fetch

> + 提供最常用的 fetch 的使用方式

Latest version **1.0.0** (published 2020-12-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install @liter/common-fetch
pnpm add @liter/common-fetch
yarn add @liter/common-fetch
bun add @liter/common-fetch
```

## 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.0.0 |
| Published | 2020-12-28 |
| First published | 2020-12-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | gy |
| Maintainers | dggy |
| Keywords | fetch |

## Links

- npm: https://www.npmjs.com/package/@liter/common-fetch
- npm.io page: https://npm.io/package/@liter/common-fetch

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2020-12-28

## README

# common fetch
+ 提供最常用的 fetch 的使用方式

## 为什么用 fetch
传统的 ajax，一般使用回调方法，来处理响应、异常  
写起来，很难看  

## 为什么不用 axios
axios 提供 Promise 写法，而且兼容性更强  
如果需要更强的兼容性，那当然应该使用 axios  
但是如果你**不需要很强的兼容性**，而且**想让项目更轻**，则应该使用 fetch  

## common fetch 和 fetch 的区别？
fetch 作为一个基础的 api，应当提供全面的功能  
这注定了 fetch 要提供很多“选项”，**很多不常用的选项**  
当你面对一个全是按钮的桌面，而你每天几乎只使用一个按钮  
那**为什么不把其他按钮遮住呢**  
**生活应该简洁**  
这就是 common fetch 产生的原因  

## 常用？
+ 数据交互格式 json
+ 不使用 http 状态码

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