From 9e3d1087718d7c4b5bc4ec24cdee525da357652b Mon Sep 17 00:00:00 2001 From: amitdhiman-os Date: Tue, 28 Apr 2026 14:57:01 +0530 Subject: [PATCH 1/2] Added a way to use custom rust binary Added a way to use custom rust binary --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 2fd6ddc..a05155f 100644 --- a/README.md +++ b/README.md @@ -637,3 +637,14 @@ const builder = Builder.new(urlSettings); - `generate_c2pa_archive` - Whether to generate C2PA archive format **Note:** Settings are passed as per-instance configuration. There are no global settings that affect all Readers and Builders. + + +### Build and use custom binary +**Build rust binary:** +``` +npm run build:rust +``` +**Use custom rust binary:** +```bash +export C2PA_LIBRARY_PATH=/index.node +``` From b48af15ea30fa5fe42735be4e5ffac563659130a Mon Sep 17 00:00:00 2001 From: amitdhiman-os Date: Tue, 28 Apr 2026 14:58:27 +0530 Subject: [PATCH 2/2] Update binary.ts --- js-src/binary.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js-src/binary.ts b/js-src/binary.ts index c914559..5591533 100644 --- a/js-src/binary.ts +++ b/js-src/binary.ts @@ -23,7 +23,8 @@ let neon: any = null; // Get the binary module (loads synchronously on first access) export function getNeonBinary() { if (neon === null) { - neon = require("./index.node"); + const C2PA_LIBRARY_PATH = process.env.C2PA_LIBRARY_PATH; + neon = require(C2PA_LIBRARY_PATH ?? "./index.node"); } return neon; }