JSPM

@zayne-labs/callapi

1.6.11
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 251
  • Score
    100M100P100Q109549F
  • License MIT

A lightweight wrapper over fetch with quality of life improvements like built-in request cancellation, retries, interceptors and more

Package Exports

    Readme

    CallApi

    Build SizeVersion

    CallApi Fetch is an extra-lightweight wrapper over fetch that provides quality of life improvements beyond the bare fetch api, while keeping the API familiar.

    It takes in a url and a request options object, just like fetch, but with some additional options to make your life easier. Check out the API Reference for a quick look at each option.

    Docs

    View Documentation website

    Installing CallApi

    # npm
    npm install @zayne-labs/callapi
    
    # pnpm
    pnpm add @zayne-labs/callapi

    Then you can use it by importing it in your JavaScript file.

    import { callApi } from "@zayne-labs/callapi";

    Using CallApi without npm

    You can import callApi directly into JavaScript through a CDN.

    To do this, you first need to set your script's type to module, then import callApi.

    <script type="module">
     import { callApi } from "https://esm.run/@zayne-labs/callapi";
    </script>
    
    <!-- Locked to a specific version -->
    <script type="module">
     import { callApi } from "https://esm.run/@zayne-labs/callapi@0.3.2";
    </script>