Skip to content

Commit 0936a9a

Browse files
author
Antoni Kepinski
committed
fix: change Mb to MB
1 parent 73b7a08 commit 0936a9a

File tree

1 file changed

+44
-41
lines changed

1 file changed

+44
-41
lines changed

README.md

Lines changed: 44 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -27,50 +27,50 @@
2727
- [Loading and configuring the module](#loading-and-configuring-the-module)
2828
- [Upgrading](#upgrading)
2929
- [Common Usage](#common-usage)
30-
- [Plain text or HTML](#plain-text-or-html)
31-
- [JSON](#json)
32-
- [Simple Post](#simple-post)
33-
- [Post with JSON](#post-with-json)
34-
- [Post with form parameters](#post-with-form-parameters)
35-
- [Handling exceptions](#handling-exceptions)
36-
- [Handling client and server errors](#handling-client-and-server-errors)
37-
- [Handling cookies](#handling-cookies)
30+
- [Plain text or HTML](#plain-text-or-html)
31+
- [JSON](#json)
32+
- [Simple Post](#simple-post)
33+
- [Post with JSON](#post-with-json)
34+
- [Post with form parameters](#post-with-form-parameters)
35+
- [Handling exceptions](#handling-exceptions)
36+
- [Handling client and server errors](#handling-client-and-server-errors)
37+
- [Handling cookies](#handling-cookies)
3838
- [Advanced Usage](#advanced-usage)
39-
- [Streams](#streams)
40-
- [Buffer](#buffer)
41-
- [Accessing Headers and other Meta data](#accessing-headers-and-other-meta-data)
42-
- [Extract Set-Cookie Header](#extract-set-cookie-header)
43-
- [Post data using a file stream](#post-data-using-a-file-stream)
44-
- [Post with form-data (detect multipart)](#post-with-form-data-detect-multipart)
45-
- [Request cancellation with AbortSignal](#request-cancellation-with-abortsignal)
39+
- [Streams](#streams)
40+
- [Buffer](#buffer)
41+
- [Accessing Headers and other Meta data](#accessing-headers-and-other-meta-data)
42+
- [Extract Set-Cookie Header](#extract-set-cookie-header)
43+
- [Post data using a file stream](#post-data-using-a-file-stream)
44+
- [Post with form-data (detect multipart)](#post-with-form-data-detect-multipart)
45+
- [Request cancellation with AbortSignal](#request-cancellation-with-abortsignal)
4646
- [API](#api)
47-
- [fetch(url[, options])](#fetchurl-options)
48-
- [Options](#options)
49-
- [Default Headers](#default-headers)
50-
- [Custom Agent](#custom-agent)
51-
- [Custom highWaterMark](#custom-highwatermark)
52-
- [Class: Request](#class-request)
53-
- [new Request(input[, options])](#new-requestinput-options)
54-
- [Class: Response](#class-response)
55-
- [new Response([body[, options]])](#new-responsebody-options)
56-
- [response.ok](#responseok)
57-
- [response.redirected](#responseredirected)
58-
- [Class: Headers](#class-headers)
59-
- [new Headers([init])](#new-headersinit)
60-
- [Interface: Body](#interface-body)
61-
- [body.body](#bodybody)
62-
- [body.bodyUsed](#bodybodyused)
63-
- [body.arrayBuffer()](#bodyarraybuffer)
64-
- [body.blob()](#bodyblob)
65-
- [body.json()](#bodyjson)
66-
- [body.text()](#bodytext)
67-
- [body.buffer()](#bodybuffer)
68-
- [Class: FetchError](#class-fetcherror)
69-
- [Class: AbortError](#class-aborterror)
47+
- [fetch(url[, options])](#fetchurl-options)
48+
- [Options](#options)
49+
- [Default Headers](#default-headers)
50+
- [Custom Agent](#custom-agent)
51+
- [Custom highWaterMark](#custom-highwatermark)
52+
- [Class: Request](#class-request)
53+
- [new Request(input[, options])](#new-requestinput-options)
54+
- [Class: Response](#class-response)
55+
- [new Response([body[, options]])](#new-responsebody-options)
56+
- [response.ok](#responseok)
57+
- [response.redirected](#responseredirected)
58+
- [Class: Headers](#class-headers)
59+
- [new Headers([init])](#new-headersinit)
60+
- [Interface: Body](#interface-body)
61+
- [body.body](#bodybody)
62+
- [body.bodyUsed](#bodybodyused)
63+
- [body.arrayBuffer()](#bodyarraybuffer)
64+
- [body.blob()](#bodyblob)
65+
- [body.json()](#bodyjson)
66+
- [body.text()](#bodytext)
67+
- [body.buffer()](#bodybuffer)
68+
- [Class: FetchError](#class-fetcherror)
69+
- [Class: AbortError](#class-aborterror)
7070
- [TypeScript](#typescript)
7171
- [Acknowledgement](#acknowledgement)
7272
- [Team](#team)
73-
- [Former](#former)
73+
- [Former](#former)
7474
- [License](#license)
7575

7676
<!-- /TOC -->
@@ -491,7 +491,7 @@ const options = {
491491

492492
#### Custom highWaterMark
493493

494-
Stream on Node.js have a smaller internal buffer size (16Kb, aka `highWaterMark`) from client-side browsers (>1Mb, not consistent across browsers). Because of that, when you are writing an isomorphic app and using `res.clone()`, it will hang with large response in Node.
494+
Stream on Node.js have a smaller internal buffer size (16Kb, aka `highWaterMark`) from client-side browsers (>1MB, not consistent across browsers). Because of that, when you are writing an isomorphic app and using `res.clone()`, it will hang with large response in Node.
495495

496496
The recommended way to fix this problem is to resolve cloned response in parallel:
497497

@@ -513,7 +513,10 @@ If for some reason you don't like the solution above, since `3.x` you are able t
513513
```js
514514
const fetch = require('node-fetch');
515515

516-
fetch('https://example.com', {highWaterMark: 10}).then(res => res.clone().buffer());
516+
fetch('https://example.com', {
517+
// About 1MB
518+
highWaterMark: 1024 * 1024
519+
}).then(res => res.clone().buffer());
517520
```
518521

519522
<a id="class-request"></a>

0 commit comments

Comments
 (0)