Skip to content

Commit c11f90d

Browse files
committed
Document the exported methods explicitly
1 parent eaf5578 commit c11f90d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ You should be able to import this directly into Node, as normal, or into a brows
2020

2121
The browser build supports both sync (v4 or v5 syncWebAssembly mode) and async (v5 asyncWebAssembly) builds. When imported in a browser build the module always exports a _promise_, not a fixed value, as this is a requirement for synchronous builds, and you will need to `await` this after import.
2222

23+
In both builds, the module exposes two methods:
24+
25+
* `compress(Buffer, [options])` - compresses a buffer using Brotli, returning the compressed buffer. An optional options object can be provided. The only currently supported option is `quality`: a number between 1 and 11.
26+
* `decompress(Buffer)` - decompresses a buffer using Brotli, returning the original raw data.
27+
2328
In node.js:
2429

2530
```javascript

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub fn compress(buf: Box<[u8]>, raw_options: &JsValue) -> Result<Box<[u8]>, JsVa
4141
} else {
4242
return Err(JsValue::from_str("Options is not an object"));
4343
}
44-
44+
4545
let mut out = Vec::<u8>::new();
4646
let mut params = brotli::enc::BrotliEncoderParams::default();
4747
params.quality = options.quality;

0 commit comments

Comments
 (0)