cross-fetch-json

Universal fetch API that only returns JSON

Usage no npm install needed!

<script type="module">
  import crossFetchJson from 'https://cdn.skypack.dev/cross-fetch-json';
</script>

README

cross-fetch-json

npm typescript GitHub stars Twitter Follow

Universal fetch API that only returns JSON.

Installation

yarn add cross-fetch-json
npm install cross-fetch-json

API

Types

import fetch, { JSONValue, JSONObject, JSONArray } from "cross-fetch-json";

function fetch<T extends JSONValue>(info: RequestInfo, init?: RequestInit): Promise<T | undefined>;

type JSONValue = string | number | boolean | JSONObject | JSONArray

Dependenciesdependencies


Dev DependenciesDavid


License license

MIT


Related Packages: