Skip to content

Commit df75f59

Browse files
committed
Update README
1 parent 8f059a0 commit df75f59

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Diff for: README.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ It allows you to easily create [Blob](https://developer.mozilla.org/en-US/docs/W
66

77
## Features
88

9+
- Deferred loading of blob/file contents to minimize memory usage
910
- `LazyBlob extends Blob` and `LazyFile extends File` so instances can be used anywhere you'd normally expect a regular `Blob`/`File`
1011
- Accepts all the same content types as the original [`Blob()`](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob) and [`File()`](https://developer.mozilla.org/en-US/docs/Web/API/File/File) constructors
1112
- Supports [`Blob.slice()`](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice), even on streaming content
12-
- Memory efficient!
1313

1414
## The Problem
1515

@@ -19,7 +19,16 @@ JavaScript's [File API](https://developer.mozilla.org/en-US/docs/Web/API/File) i
1919
let file = new File(["hello world"], "hello.txt", { type: "text/plain" });
2020
```
2121

22-
A `LazyFile` improves this model by accepting an additional content type in its constructor: `LazyContent`. All other `File` functionality works as you'd expect.
22+
A `LazyFile` improves this model by accepting an additional content type in its constructor: `LazyContent`.
23+
24+
```ts
25+
let lazyContent: LazyContent = {
26+
/* See below for usage */
27+
};
28+
let file = new File(lazyContent, "hello.txt", { type: "text/plain" });
29+
```
30+
31+
All other `File` functionality works as you'd expect.
2332

2433
## Installation
2534

0 commit comments

Comments
 (0)