Skip to content

Commit

Permalink
Fix Node.js compatibility
Browse files Browse the repository at this point in the history
Fixes #452
  • Loading branch information
sindresorhus committed Sep 3, 2022
1 parent 8a4bb62 commit 0b141f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[![Coverage Status](https://codecov.io/gh/sindresorhus/ky/branch/main/graph/badge.svg)](https://codecov.io/gh/sindresorhus/ky)
[![](https://badgen.net/bundlephobia/minzip/ky)](https://bundlephobia.com/result?p=ky)

Ky targets [modern browsers](#browser-support) and [Deno](https://github.com/denoland/deno). For older browsers, you will need to transpile and use a [`fetch` polyfill](https://github.com/github/fetch) and [`globalThis` polyfill](https://github.com/es-shims/globalThis). For Node.js, check out [Got](https://github.com/sindresorhus/got). For isomorphic needs (like SSR), check out [`ky-universal`](https://github.com/sindresorhus/ky-universal).
Ky targets [modern browsers](#browser-support) and [Deno](https://github.com/denoland/deno). For older browsers, you will need to transpile and use a [`fetch` polyfill](https://github.com/github/fetch) and [`globalThis` polyfill](https://github.com/es-shims/globalThis). For isomorphic needs (Node.js + browser, like SSR), check out [`ky-universal`](https://github.com/sindresorhus/ky-universal).

It's just a tiny file with no dependencies.

Expand All @@ -33,8 +33,8 @@ It's just a tiny file with no dependencies.

## Install

```
$ npm install ky
```sh
npm install ky
```

###### Download
Expand Down
2 changes: 1 addition & 1 deletion source/core/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const supportsStreams = (() => {
const supportsReadableStream = typeof globalThis.ReadableStream === 'function';

if (supportsReadableStream) {
hasContentType = new globalThis.Request('', {
hasContentType = new globalThis.Request('https://a.com', {
body: new globalThis.ReadableStream(),
method: 'POST',
// @ts-expect-error - Types are outdated.
Expand Down

0 comments on commit 0b141f1

Please sign in to comment.