Skip to content

Commit 792a6c9

Browse files
authored
Merge pull request #20 from josephrocca/patch-1
Add CDN loading example
2 parents 4523548 + b064e34 commit 792a6c9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ const decompressedData = brotli.decompress(compressedData);
6161
console.log(textDecoder.decode(decompressedData)); // Prints 'some input'
6262
```
6363

64+
You can also load it from a CDN like so:
65+
```javascript
66+
let brotli = await import("https://unpkg.com/[email protected]/index.web.js?module").then(m => m.default);
67+
```
68+
6469
The package itself has no runtime dependencies, although if you prefer using `Buffer` over using `TextEncoder/TextDecoder` you may want a [browser Buffer polyfill](https://www.npmjs.com/package/browserify-zlib).
6570

6671
#### In browser with streams:

0 commit comments

Comments
 (0)