sasaxios
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

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
});

Readme

Keywords

none

Package Sidebar

Install

npm i sasaxios

Weekly Downloads

1

Version

0.3.0

License

ISC

Unpacked Size

103 kB

Total Files

24

Last publish

Collaborators

  • shingo.sasaki