You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WASM and ASM versions are built nightly from the binaries provided (nightly) by [kiwix-build](https://github.com/kiwix/kiwix-build). The artefacts are
20
-
made available at https://download.openzim.org/nightly/ (if tests pass). Artefacts for PRs and pushes are attached to the respective workflow run.
20
+
made available at https://download.openzim.org/nightly/ (if tests pass). Artefacts for PRs and pushes are attached to the respective workflow run.**Please note that currently, versions built form precompiled binaries lack the snippets support, because this support relies on a patch to the source code to override exceptions-based programme flow which cannot be handled well in WASM.** Therefore, to use the full functionality, it is currently necessary to compile from source using, e.g. `docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) docker-emscripten-libzim:v3 make`.
21
21
22
22
Released versions are published both in [Releases](https://github.com/openzim/javascript-libzim/releases) and at https://download.openzim.org/release/javascript-libzim/.
23
23
@@ -28,6 +28,165 @@ to and received from the Worker via [`window.postMessage()`](https://developer.m
28
28
You can change the File Systems and other parameters in the provided [Makefile](https://github.com/openzim/javascript-libzim/blob/main/Makefile) in
29
29
this Repository. This recipe needs to be run in an Emscripten-configured system or a customized Emscripten container (see below).
30
30
31
+
## JavaScript API Bindings
32
+
33
+
This section documents the JavaScript API bindings that are available after loading the compiled W/ASM module. The bindings provide access to libzim's core functionality including archive loading, content access, and search capabilities.
34
+
35
+
### Archive Management
36
+
37
+
#### `Module.loadArchive(filename: string): void`
38
+
Loads a ZIM archive for subsequent operations.
39
+
```javascript
40
+
Module.loadArchive("path/to/archive.zim");
41
+
```
42
+
43
+
#### `Module.getArticleCount(): number`
44
+
Returns the total number of articles in the loaded archive.
0 commit comments