Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5bfe688
Started Upgrade to libzim 9.4.0 (future)
kelvinhammond Oct 8, 2025
3df0a45
Minor changes to include map and add TODO comment
kelvinhammond Oct 8, 2025
754731b
Add missing iostream
kelvinhammond Oct 8, 2025
d9222d5
Update READMe.md
kelvinhammond Nov 13, 2025
9304e8e
Update dependencies
kelvinhammond Nov 13, 2025
36f1a7b
Added: Illustration class
kelvinhammond Nov 13, 2025
b6cff2e
Removed unused illustration implementation
kelvinhammond Nov 13, 2025
2f5681f
Fixed: package.json test commands
kelvinhammond Dec 9, 2025
d2154ab
Added: OpenConfig class and test
kelvinhammond Dec 9, 2025
a09e756
Added: Support for Archive(filename, config)
kelvinhammond Dec 9, 2025
26172af
Added: InstanceOf to OpenConfig
kelvinhammond Dec 9, 2025
6092e85
Added: IllustrationInfo object
kelvinhammond Dec 9, 2025
99587e1
Added: Archive Illustration methods
kelvinhammond Dec 9, 2025
f4abe86
Added: Creator.addIllustration(IllustrationInfo)
kelvinhammond Dec 9, 2025
535edbe
Pretty code
kelvinhammond Dec 9, 2025
cfd67a1
Run eslint fix over code
kelvinhammond Dec 9, 2025
bc28c79
Fixed: aarch64 library path build paths
kelvinhammond Dec 9, 2025
b4e3e51
Updated: Removed deprecated macos-13 build from ci
kelvinhammond Dec 10, 2025
99d4367
Removed HandleScope from entryrange.h
kelvinhammond Dec 10, 2025
3025ec4
Removed: unused EntryRange
kelvinhammond Dec 10, 2025
b04096f
Updated: Use string cast for uuid
kelvinhammond Dec 10, 2025
34bebcc
Updated: Blob rewrite to use interal shared_ptr
kelvinhammond Dec 10, 2025
848791d
Removed: HandleScope calls and code cleanup
kelvinhammond Dec 10, 2025
487b96b
Fixes: Segmentation Fault when using a custom item
kelvinhammond Dec 10, 2025
c826f15
Fixed: Linting errors, I hope
kelvinhammond Dec 10, 2025
9f4cd78
Code Factor cleanup
kelvinhammond Dec 11, 2025
50ad63f
Apply suggestions from code review
kelvinhammond Dec 11, 2025
2ec85e8
Added: macos-15-intel to CI
kelvinhammond Dec 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
LIBZIM_VERSION=9.3.0
LIBZIM_VERSION=9.4.0
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-22.04-arm, ubuntu-24.04, ubuntu-24.04-arm, macos-13, macos-14, macos-15]
os: [ubuntu-22.04, ubuntu-22.04-arm, ubuntu-24.04, ubuntu-24.04-arm, macos-14, macos-15, macos-15-intel]
node: [20, 22, 24]
runs-on: ${{ matrix.os }}

Expand Down
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,44 @@ import { Archive, SuggestionSearcher, Searcher } from "@openzim/libzim";
delete archive;
})();

## Local Development

### Important Files
`.env` - Set environment variables for local development. Only LIBZIM_VERSION for now
`bindings.gyp` - Node-gyp build configuration file
`src/` - Source code for the Node.js bindings
`test/` - Test cases

### Setup

```bash
git clone [email protected]:openzim/node-libzim.git
cd node-libzim

# Will install dependencies, download libzim binary and build the bindings
npm run install

# Required in order for local binding and tests to work.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/download/lib/x86_64-linux-gnu
```

### Iterating during development

Make your changes in `src/` and then run:
```bash
node-gyp rebuild --debug -v && npx jest ./test/zim.test.ts
```

### Updating libzim version
To update the libzim version used, change the `LIBZIM_VERSION` variable in
`.env` file to the desired version and run:
```bash
npm run install
```

If you are upgrading libzim from a major version you will need to edit the `bundle-libzim.js` file
and change the `libzim.so*` file names to match the new version.

## License

[GPLv3](https://www.gnu.org/licenses/gpl-3.0) or later, see
Expand Down
4 changes: 2 additions & 2 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
],
"libraries": [
"-Wl,-rpath,'$$ORIGIN'",
"-L<(libzim_dir)/lib/aarch64-linux-gnu",
"<(libzim_dir)/lib/aarch64-linux-gnu/libzim.so.9",
"-L<(libzim_dir)/lib/aarch64-rpi3-linux-gnu",
"<(libzim_dir)/lib/aarch64-rpi3-linux-gnu/libzim.so.9",
],
}],
["libzim_local!='true' and OS=='linux' and target_arch=='arm'", {
Expand Down
2 changes: 1 addition & 1 deletion bundle-libzim.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (isLinux) {
const rawArch = os.arch();
let libDir;
if (rawArch === "arm64") {
libDir = "aarch64-linux-gnu";
libDir = "aarch64-rpi3-linux-gnu";
} else if (rawArch === "arm") {
libDir = "arm-linux-gnueabihf";
} else {
Expand Down
3 changes: 1 addition & 2 deletions download-libzim.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { mkdirp } from "mkdirp";
import exec from "exec-then";
import os from "os";
import fs from "fs";
import urlParser from "url";

mkdirp.sync("./download");

Expand Down Expand Up @@ -46,7 +45,7 @@ const urls = [

for (let url of urls) {
console.info(`Downloading Libzim from: `, url);
const filename = urlParser.parse(url).pathname.split("/").slice(-1)[0];
const filename = new URL(url).pathname.split("/").slice(-1)[0];
const dlFile = `./download/${filename}`;

try {
Expand Down
Loading