File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ The package itself has no runtime dependencies, although if you prefer using `Bu
70
70
71
71
##### Using an importmap
72
72
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 :
74
74
75
75
``` html
76
76
<!-- index.html -->
@@ -81,7 +81,7 @@ If you've installed `brotli-wasm` as an NPM package, you can load it from the `n
81
81
<script type =" importmap" >
82
82
{
83
83
" imports" : {
84
- " brotli-wasm" : " . /node_modules/brotli-wasm/index.web.js"
84
+ " brotli-wasm" : " /node_modules/brotli-wasm/index.web.js"
85
85
}
86
86
}
87
87
</script >
@@ -92,9 +92,10 @@ If you've installed `brotli-wasm` as an NPM package, you can load it from the `n
92
92
93
93
``` javascript
94
94
// main.js
95
+ import brotliPromise from ' brotli-wasm' ;
95
96
const brotli = await brotliPromise;
96
- const input = ' some input' ;
97
97
98
+ const input = ' some input' ;
98
99
const uncompressedData = new TextEncoder ().encode (input);
99
100
const compressedData = brotli .compress (uncompressedData);
100
101
const decompressedData = brotli .decompress (compressedData);
You can’t perform that action at this time.
0 commit comments