fix: change Mb to MB

This commit is contained in:
Antoni Kepinski 2020-05-11 12:21:57 +02:00
parent 73b7a08974
commit 0936a9af0a
No known key found for this signature in database
GPG Key ID: C15767C6F117A9B6
1 changed files with 44 additions and 41 deletions

View File

@ -491,7 +491,7 @@ const options = {
#### Custom highWaterMark #### Custom highWaterMark
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. 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.
The recommended way to fix this problem is to resolve cloned response in parallel: The recommended way to fix this problem is to resolve cloned response in parallel:
@ -513,7 +513,10 @@ If for some reason you don't like the solution above, since `3.x` you are able t
```js ```js
const fetch = require('node-fetch'); const fetch = require('node-fetch');
fetch('https://example.com', {highWaterMark: 10}).then(res => res.clone().buffer()); fetch('https://example.com', {
// About 1MB
highWaterMark: 1024 * 1024
}).then(res => res.clone().buffer());
``` ```
<a id="class-request"></a> <a id="class-request"></a>