You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add Open.custom to provide unzipping from a custom source
* Fix readme code block
* Tweak readme for Open.custom
* Update Open.custom example with Google Cloud Storage
This better explains the use-case for using a custom source.
Copy file name to clipboardexpand all lines: README.md
+35
Original file line number
Diff line number
Diff line change
@@ -317,6 +317,41 @@ async function main() {
317
317
main();
318
318
```
319
319
320
+
### Open.custom(source, [options])
321
+
This function can be used to provide a custom source implementation. The source parameter expects a `stream` and a `size` function to be implemented. The size function should return a `Promise` that resolves the total size of the file. The stream function should return a `Readable` stream according to the supplied offset and length parameters.
322
+
323
+
Example:
324
+
325
+
```js
326
+
// Custom source implementation for reading a zip file from Google Cloud Storage
The directory object returned from `Open.[method]` provides an `extract` method which extracts all the files to a specified `path`, with an optional `concurrency` (default: 1).
0 commit comments