s-sasaki-0529 / sasaxios

Fetch wrapper like Axios API

Home Page:https://www.npmjs.com/package/sasaxios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sasaxios

sasaxios is a wrapper for fetch(), but provides an axios-like interface.

This package is not production-ready so that should be used with caution.

Install

$ npm install sasaxios

or

$ yarn add sasaxios

Usage

import sasaxios from "sasaxios";

const axios = sasaxios.create({
  baseURL: "https://pokeapi.co/api/v2",
  withCredentials: false,
});

// request to https://pokeapi.co/api/v2/pokemon?limit=5&offset=10
axios.get("pokemon", { params: { limit: 5, offset: 10 } }).then((response) => {
  console.log(response.data.results[0].name); // metapod
});

About

Fetch wrapper like Axios API

https://www.npmjs.com/package/sasaxios


Languages

Language:TypeScript 98.5%Language:JavaScript 1.5%