1.0.13 • Published 3 years ago

fetch-no-cors v1.0.13

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Fetch No CORS

Bypass CORS for browser's Fetch API using https://github.com/Rob--W/cors-anywhere

  1. Installation

npm:

npm i fetch-no-cors

yarn:

yarn add fetch-no-cors
  1. Use

It's exactly like how we use the original fetch, you can either use it with await/async:

import fetchNoCors from "fetch-no-cors"

// You need to setup your own cors-anywhere proxy instance using https://github.com/Rob--W/cors-anywhere
const CORS_ANYWHERE = "https://my-own-cors-anywhere-proxy.com"
const foo = async (url, options, CORS_ANYWHERE) => {
  const res = await fetchNoCors(url, options)
  console.log(res)
}

or:

fetchNoCors(url, options, CORS_ANYWHERE)
  .then(res => console.log(res))
  .catch(err => console.error(err))
1.0.13

3 years ago

1.0.11

3 years ago

1.0.12

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago