# fetch-jsonp-polyfill

> a jsonp fetch polyfill

Latest version **1.1.5** (published 2018-04-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install fetch-jsonp-polyfill
pnpm add fetch-jsonp-polyfill
yarn add fetch-jsonp-polyfill
bun add fetch-jsonp-polyfill
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.5 |
| Published | 2018-04-03 |
| First published | 2018-04-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | a-jie |
| Maintainers | ajiemath |
| Keywords | fetch, jsonp |

## Links

- npm: https://www.npmjs.com/package/fetch-jsonp-polyfill
- npm.io page: https://npm.io/package/fetch-jsonp-polyfill

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.1.5 (latest) — 2018-04-03
- 1.1.3 — 2018-04-02
- 1.1.2 — 2018-04-02
- 1.1.0 — 2018-04-01
- 1.0.0 — 2018-04-01

## README

# fetch-jsonp-polyfill

JSONP is NOT supported in standard Fetch API.If you are sleepy for such a problem, please use this Polyfill.

## Installation
You can install with npm.
```
npm install fetch-jsonp-polyfill --save-dev
```

## Notice
He can be compatible with almost all current jsonp polyfills, including[https://github.com/github/fetch](https://github.com/github/fetch) [https://github.com/matthew-andrews/isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) [https://github.com/bitinn/node-fetch](https://github.com/bitinn/node-fetch) and many more.

Please note that they must be imported after them.

```
require('isomorphic-fetch');
require('fetch-jsonp-polyfill');
```


## Usage
You don't need to make any changes, just modify the `method:'GET'` to `method:'JSONP'`.
In this way, I didn't modify any native code.
```
var URL = 'http://jsfiddle.net/echo/jsonp/';

fetch(URL, {
    method: "JSONP"
})
.then(res => res.json())
.then(data => {
    console.log(data);
})
.catch(err => {
    console.log(err);
});
```

## Other Options
```
fetch(URL, {
    method: 'JSONP',
    timeout: 5000,
    callback: 'callback',
    callbackName: 'fetchjsonp_callback',
})
```

## Browser Support

![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_7-8/internet-explorer_7-8_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png)
--- | --- | --- | --- | --- |
Latest ✔ | Latest ✔ | 9+ ✔ | Latest ✔ | 6.1+ ✔ |

## License

MIT

---
_Source: https://npm.io/package/fetch-jsonp-polyfill · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
