ky-universal
Advanced tools
Comparing version 0.11.0 to 0.12.0
import fetch, {Headers, Request, Response} from 'node-fetch'; | ||
import AbortController from 'abort-controller'; | ||
@@ -22,6 +21,2 @@ const TEN_MEGABYTES = 1000 * 1000 * 10; | ||
if (!globalThis.AbortController) { | ||
globalThis.AbortController = AbortController; | ||
} | ||
if (!globalThis.ReadableStream) { | ||
@@ -28,0 +23,0 @@ try { |
{ | ||
"name": "ky-universal", | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"description": "Use Ky in both Node.js and browsers", | ||
@@ -19,3 +19,3 @@ "license": "MIT", | ||
"engines": { | ||
"node": ">=14.16" | ||
"node": ">=16" | ||
}, | ||
@@ -63,13 +63,12 @@ "scripts": { | ||
"dependencies": { | ||
"abort-controller": "^3.0.0", | ||
"node-fetch": "^3.2.10" | ||
"node-fetch": "^3.3.2" | ||
}, | ||
"devDependencies": { | ||
"ava": "^4.3.3", | ||
"ky": "^0.31.4", | ||
"tsd": "^0.24.1", | ||
"xo": "^0.52.4" | ||
"ava": "^5.3.1", | ||
"ky": "^0.33.3", | ||
"tsd": "^0.28.1", | ||
"xo": "^0.55.0" | ||
}, | ||
"peerDependencies": { | ||
"ky": ">=0.31.4", | ||
"ky": ">=0.33.0", | ||
"web-streams-polyfill": ">=3.2.1" | ||
@@ -76,0 +75,0 @@ }, |
@@ -5,3 +5,3 @@ # ky-universal | ||
[Ky](https://github.com/sindresorhus/ky) is made for browsers, but this package makes it possible to use it in Node.js too, by polyfilling most of the required browser APIs using [`node-fetch`](https://github.com/bitinn/node-fetch) and [`abort-controller`](https://github.com/mysticatea/abort-controller). | ||
[Ky](https://github.com/sindresorhus/ky) is made for browsers, but this package makes it possible to use it in Node.js too, by polyfilling most of the required browser APIs using [`node-fetch`](https://github.com/bitinn/node-fetch). | ||
@@ -13,8 +13,6 @@ This package can be useful for: | ||
**Note:** Before opening an issue, make sure it's an issue with Ky and not its polyfills. Generally, if something works in the browser, but not in Node.js, it's an issue with `node-fetch` or `abort-controller`. | ||
**Note:** Before opening an issue, make sure it's an issue with Ky and not its polyfills. Generally, if something works in the browser, but not in Node.js, it's an issue with `node-fetch`. | ||
Keep in mind that Ky targets [modern browsers](https://github.com/sindresorhus/ky#browser-support) when used in the browser. For older browsers, you will need to transpile and use a [`fetch` polyfill](https://github.com/github/fetch). | ||
**If you only target Node.js, I would strongly recommend using [Got](https://github.com/sindresorhus/got) instead.** | ||
## Install | ||
@@ -21,0 +19,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3
6368
28
111
- Removedabort-controller@^3.0.0
- Removedabort-controller@3.0.0(transitive)
- Removedevent-target-shim@5.0.1(transitive)
Updatednode-fetch@^3.3.2