stonexer / yab

🐈 A fetch library
4 stars 0 forks source link

logo

A simple fetch library.


Introduction

Yab is a high-level HTTP client based on Fetch API and koa-like middlewares.

Features

Browser Support

This library can only be used in modern browser environment. Polyfill may be needed.

Install

npm

npm install yab-fetch

yarn

yarn add yab-fetch

CDN

<script src="https://unpkg.com/yab-fetch.min.js"></script>

Useage

Basic Usage ```ts import { createFetch } from "yab-fetch"; const request = createFetch(); request.get("https://example.com"); ```
Middleware Usage ```ts import { createFetch } from "yab-fetch"; import { createCache } from "yab-fetch-cache"; const request = createFetch(); request.use(createCache()); request.get("https://example.com"); ```

Documents

See full documents, please read Yab-fetch.

Packages

This repository is a monorepo that we manage using Lerna. That means that we actually publish several packages to npm from the same codebase, including:

Package Version Description
yab-fetch npm The fetch library.
yab-fetch-cache npm A yab middleware, focus on cache response using IndexDB.

Changelog

Detailed changes for each release are documented in CHANGELOG.md.

Contributors

Thanks goes to the wonderful people.

License

MIT