Skip to content

Commit e68d55d

Browse files
committed
Fix README
1 parent 35dfc22 commit e68d55d

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

README.md

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,19 @@ import fetchInChunks from 'fetch-in-chunks';
2525
async function fetchInChunks(url, options = {})
2626
```
2727

28-
### Options Object
29-
30-
- `chunkSize` (`number`, optional): The size of each chunk in bytes. Defaults to
31-
5 MB (5 _ 1024 _ 1024).
32-
- `maxParallelRequests` (`number`, optional): The maximum number of parallel
33-
chunk requests. Defaults to 6. `progressCallback` (`function`, optional): A
34-
callback function that is called with the downloaded bytes and total file
35-
size. `signal` (`AbortSignal`, optional): An `AbortSignal` to allow aborting
36-
the request.
37-
3828
#### Parameters
3929

4030
- `url` (`string`): The URL of the file to download.
41-
- `chunkSize` (`number`, optional): The size of each chunk in bytes. Defaults to
42-
5 MB.
43-
- `maxParallelRequests` (`number`, optional): The maximum number of parallel
44-
chunk requests. Defaults to 6.
45-
- `progressCallback` (`function`, optional): A callback function that is called
46-
with the downloaded bytes and total file size. `signal` (`AbortSignal`,
47-
optional): An `AbortSignal` to allow aborting the request.
31+
- `options` (`object`, optional): An object containing additional options.
32+
- `options.chunkSize` (`number`, default: `5 * 1024 * 1024`): The size of each
33+
chunk to download in bytes.
34+
- `options.maxParallelRequests` (`number`, default: `1`): The number of chunks
35+
to download in parallel.
36+
- `options.progressCallback` (`function`, optional): A callback function that
37+
will be called with the number of bytes downloaded and the total size of the
38+
file.
39+
- `options.signal` (`AbortSignal`, optional): An `AbortSignal` object that can
40+
be used to abort the download.
4841

4942
#### Returns
5043

0 commit comments

Comments
 (0)