@d0paminedriven/pdfdown-ocr 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,10 +1,4 @@
1
- // Bound Tesseract's OpenMP pool before libtesseract loads: libgomp reads the environment in its
2
- // constructor, so this cannot be done from Rust once the native module is loaded. One OpenMP
3
- // thread per OCR worker; parallelism comes from OcrOptions.maxThreads (rayon). Measured on an
4
- // 8-core box: 7.8 s/page with the default pool, 0.6 s/page with the limit. Users who set either
5
- // OpenMP variable themselves keep their setting.
6
- if (process.env.OMP_THREAD_LIMIT === undefined && process.env.OMP_NUM_THREADS === undefined) {
7
- process.env.OMP_THREAD_LIMIT = "1";
8
- }
1
+ // The environment module is imported first, so it has run before the native loader is evaluated.
2
+ import "./omp.js";
9
3
 
10
- module.exports = require("./pdfdown_ocr.napi.js");
4
+ export * from "./pdfdown_ocr.napi.js";
package/omp.js ADDED
@@ -0,0 +1,9 @@
1
+ // Bound Tesseract's OpenMP pool before libtesseract loads: libgomp reads the environment in its
2
+ // constructor, so this cannot be done from Rust once the native module is loaded. One OpenMP
3
+ // thread per OCR worker; parallelism across cores comes from OcrOptions.maxThreads (rayon), so
4
+ // nothing has to be configured to use them. Measured on a 12-core box over 9 scanned pages:
5
+ // 13.7 s with the limit, 196 s without it, 223 s with the pool sized to the core count.
6
+ // Whoever does set either OpenMP variable keeps their setting.
7
+ if (!process.env.OMP_THREAD_LIMIT && !process.env.OMP_NUM_THREADS) {
8
+ process.env.OMP_THREAD_LIMIT = "1";
9
+ }
package/package.json CHANGED
@@ -1,18 +1,20 @@
1
1
  {
2
2
  "name": "@d0paminedriven/pdfdown-ocr",
3
- "version": "0.12.0",
4
- "description": "Rust powered PDF extraction for Node with OCR fallback (requires system tesseract).",
3
+ "version": "0.14.0",
4
+ "description": "Rust powered PDF extraction for Node with OCR and optional rendering (requires system tesseract).",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/DopamineDriven/pdfdown"
8
+ "url": "git+https://github.com/DopamineDriven/assetdown.git"
9
9
  },
10
10
  "files": [
11
11
  "index.d.ts",
12
12
  "index.js",
13
+ "omp.js",
13
14
  "pdfdown_ocr.napi.js",
14
15
  "README.md"
15
16
  ],
17
+ "type": "module",
16
18
  "os": [
17
19
  "darwin",
18
20
  "linux"
@@ -23,19 +25,22 @@
23
25
  "registry": "https://registry.npmjs.org/"
24
26
  },
25
27
  "napi": {
26
- "binaryName": "pdfdown_ocr",
28
+ "binaryName": "pdfdown-node-ocr",
29
+ "packageName": "@d0paminedriven/pdfdown-ocr",
27
30
  "targets": [
28
31
  "aarch64-apple-darwin",
29
32
  "x86_64-unknown-linux-gnu",
30
33
  "aarch64-unknown-linux-gnu"
31
- ]
34
+ ],
35
+ "constEnum": false,
36
+ "dtsHeader": "/* auto-generated by @d0paminedriven/pdfdown-ocr */"
32
37
  },
33
38
  "engines": {
34
- "node": ">= 26"
39
+ "node": ">=24"
35
40
  },
36
41
  "optionalDependencies": {
37
- "@d0paminedriven/pdfdown-ocr-darwin-arm64": "0.12.0",
38
- "@d0paminedriven/pdfdown-ocr-linux-x64-gnu": "0.12.0",
39
- "@d0paminedriven/pdfdown-ocr-linux-arm64-gnu": "0.12.0"
42
+ "@d0paminedriven/pdfdown-ocr-darwin-arm64": "0.14.0",
43
+ "@d0paminedriven/pdfdown-ocr-linux-x64-gnu": "0.14.0",
44
+ "@d0paminedriven/pdfdown-ocr-linux-arm64-gnu": "0.14.0"
40
45
  }
41
46
  }