Skip to content

Commit 1188902

Browse files
committed
Fix missing import
1 parent eb7d2f6 commit 1188902

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ The package itself has no runtime dependencies, although if you prefer using `Bu
7070

7171
##### Using an importmap
7272

73-
If you've installed `brotli-wasm` as an NPM package, you can load it from the `node_modules` folder:
73+
If you've installed `brotli-wasm` as an NPM package, you can load it from your `node_modules` subfolder:
7474

7575
```html
7676
<!-- index.html -->
@@ -81,7 +81,7 @@ If you've installed `brotli-wasm` as an NPM package, you can load it from the `n
8181
<script type="importmap">
8282
{
8383
"imports": {
84-
"brotli-wasm": "./node_modules/brotli-wasm/index.web.js"
84+
"brotli-wasm": "/node_modules/brotli-wasm/index.web.js"
8585
}
8686
}
8787
</script>
@@ -92,9 +92,10 @@ If you've installed `brotli-wasm` as an NPM package, you can load it from the `n
9292

9393
```javascript
9494
// main.js
95+
import brotliPromise from 'brotli-wasm';
9596
const brotli = await brotliPromise;
96-
const input = 'some input';
9797

98+
const input = 'some input';
9899
const uncompressedData = new TextEncoder().encode(input);
99100
const compressedData = brotli.compress(uncompressedData);
100101
const decompressedData = brotli.decompress(compressedData);

0 commit comments

Comments
 (0)