native-cross-fetch

Isomorphic fetch for Node and Browser environments

Usage no npm install needed!

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

README

native-cross-fetch

NPM Version License

Simple fetch for Node and Browsers. This exports the node-fetch library when used in NodeJS, and window.fetch when used in the browser. Note that if you want to use this in browsers that don't natively support fetch you will need to use a polyfill like Github's whatwg-fetch or use a different library like cross-fetch.

This was originally developed for usage in Electron apps where it can be assumed that a native fetch implementation exists.