Socket
Socket
Sign inDemoInstall

ky-universal

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ky-universal - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0

4

index.js

@@ -5,4 +5,6 @@ 'use strict';

const TEN_MEGABYTES = 1000 * 1000 * 10;
if (!global.fetch) {
global.fetch = fetch;
global.fetch = (url, options) => fetch(url, {highWaterMark: TEN_MEGABYTES, ...options});
}

@@ -9,0 +11,0 @@

{
"name": "ky-universal",
"version": "0.6.0",
"version": "0.7.0",
"description": "Use Ky in both Node.js and browsers",

@@ -14,3 +14,3 @@ "license": "MIT",

"engines": {
"node": ">=10"
"node": ">=10.16"
},

@@ -58,3 +58,3 @@ "scripts": {

"abort-controller": "^3.0.0",
"node-fetch": "^2.6.0"
"node-fetch": "^3.0.0-beta.6-exportfix"
},

@@ -61,0 +61,0 @@ "devDependencies": {

@@ -55,3 +55,3 @@ # ky-universal [![Build Status](https://travis-ci.com/sindresorhus/ky-universal.svg?branch=master)](https://travis-ci.com/sindresorhus/ky-universal)

const result = new TextDecoder('utf-8').decode(value);
// …

@@ -99,2 +99,21 @@ })();

#### `clone()` hangs with a large response in Node - What should I do?
Streams in Node.js have a smaller internal buffer size (16 kB, aka `highWaterMark`) than browsers (>1 MB, not consistent across browsers). When using Ky, the default `highWaterMark` is set to 10 MB, so you shouldn't encounter many issues related to that.
However, you can specify a custom `highWaterMark` if needed:
```js
import ky from 'ky-universal';
(async () => {
const response = await ky('https://example.com', {
// 20 MB
highWaterMark: 1000 * 1000 * 20
});
const data = await response.clone().buffer();
})();
```
## Related

@@ -101,0 +120,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc