@shopify/cli-kit
    Preparing search index...

    Function fetch

    • An interface that abstracts way node-fetch. When Node has built-in support for "fetch" in the standard library, we can drop the node-fetch dependency from here. Note that we are exposing types from "node-fetch". The reason being is that they are consistent with the Web API so if we drop node-fetch in the future it won't require changes from the callers.

      The CLI's fetch function supports special behaviours, like automatic retries. These are disabled by default through this function.

      Parameters

      • url: RequestInfo

        This defines the resource that you wish to fetch.

      • Optionalinit: RequestInit

        An object containing any custom settings that you want to apply to the request.

      • OptionalpreferredBehaviour: RequestModeInput

        A request behaviour object that overrides the default behaviour.

      Returns Promise<Response>

      A promise that resolves with the response.