@kreuzberg/wasm 4.5.2 → 4.5.4

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.
@@ -12,9 +12,9 @@ export interface InitWasmOptions {
12
12
  /**
13
13
  * A pre-loaded WebAssembly.Module for the Kreuzberg WASM binary.
14
14
  *
15
- * Required in edge environments (Cloudflare Workers, Vercel Edge) where
16
- * the runtime cannot fetch `file://` URLs. Import the `.wasm` file as a
17
- * static import in your worker and pass it here.
15
+ * Required in restricted edge environments (Cloudflare Workers, Vercel Edge,
16
+ * Supabase edge functions) where the runtime cannot fetch `file://` URLs.
17
+ * Import the `.wasm` file as a static import and pass it here.
18
18
  *
19
19
  * @example Cloudflare Workers
20
20
  * ```typescript
@@ -28,6 +28,17 @@ export interface InitWasmOptions {
28
28
  * }
29
29
  * };
30
30
  * ```
31
+ *
32
+ * @example Supabase Edge Functions (Deno)
33
+ * ```typescript
34
+ * import wasmModule from '@kreuzberg/wasm/kreuzberg_wasm_bg.wasm';
35
+ * import { initWasm, extractBytes } from '@kreuzberg/wasm';
36
+ *
37
+ * Deno.serve(async (req: Request) => {
38
+ * await initWasm({ wasmModule });
39
+ * // ... use extraction functions
40
+ * });
41
+ * ```
31
42
  */
32
43
  wasmModule?: WebAssembly.Module;
33
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"wasm-loader.d.ts","sourceRoot":"","sources":["../../typescript/initialization/wasm-loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;CAChC;AA+BD,OAAO,EACN,sBAAsB,EAEtB,aAAa,EACb,aAAa,EACb,KAAK,UAAU,EAKf,KAAK,UAAU,EACf,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AAEvC;;;;;GAKG;AACH,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB;;;;GAIG;AACH,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB;;;;;GAKG;AACH,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAElC;;;;;GAKG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAWnC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,wBAAsB,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAsFvE"}
1
+ {"version":3,"file":"wasm-loader.d.ts","sourceRoot":"","sources":["../../typescript/initialization/wasm-loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;CAChC;AAuDD,OAAO,EACN,sBAAsB,EAEtB,aAAa,EACb,aAAa,EACb,KAAK,UAAU,EAKf,KAAK,UAAU,EACf,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AAEvC;;;;;GAKG;AACH,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB;;;;GAIG;AACH,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB;;;;;GAKG;AACH,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAElC;;;;;GAKG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAWnC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,wBAAsB,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAwFvE"}
@@ -22,7 +22,7 @@
22
22
  <img src="https://img.shields.io/maven-central/v/dev.kreuzberg/kreuzberg?label=Java&color=007ec6" alt="Java">
23
23
  </a>
24
24
  <a href="https://github.com/kreuzberg-dev/kreuzberg/releases">
25
- <img src="https://img.shields.io/github/v/tag/kreuzberg-dev/kreuzberg?label=Go&color=007ec6&filter=v4.5.2" alt="Go">
25
+ <img src="https://img.shields.io/github/v/tag/kreuzberg-dev/kreuzberg?label=Go&color=007ec6&filter=v4.5.4" alt="Go">
26
26
  </a>
27
27
  <a href="https://www.nuget.org/packages/Kreuzberg/">
28
28
  <img src="https://img.shields.io/nuget/v/Kreuzberg?label=C%23&color=007ec6" alt="C#">
@@ -61,7 +61,7 @@
61
61
  </div>
62
62
 
63
63
 
64
- Extract text, tables, images, and metadata from 88+ file formats including PDF, Office documents, and images. WebAssembly bindings for browsers, Deno, and Cloudflare Workers with portable deployment and multi-threading support.
64
+ Extract text, tables, images, and metadata from 91+ file formats including PDF, Office documents, and images. WebAssembly bindings for browsers, Deno, and Cloudflare Workers with portable deployment and multi-threading support.
65
65
 
66
66
 
67
67
  ## Installation
@@ -271,9 +271,9 @@ extractDocuments(fileBytes, mimes)
271
271
 
272
272
  ## Features
273
273
 
274
- ### Supported File Formats (88+)
274
+ ### Supported File Formats (91+)
275
275
 
276
- 88+ file formats across 8 major categories with intelligent format detection and comprehensive metadata extraction.
276
+ 91+ file formats across 8 major categories with intelligent format detection and comprehensive metadata extraction.
277
277
 
278
278
  #### Office Documents
279
279
 
@@ -510,7 +510,7 @@ WASM runs in single-threaded environments without access to ONNX Runtime, which
510
510
  - **Language Detection** – Identify document language
511
511
  - **Image Extraction** – Embedded images from documents
512
512
 
513
- All 88+ file formats supported by Kreuzberg are available in WASM, with the exception that features requiring ONNX Runtime (layout detection) will fail gracefully with an unsupported error.
513
+ All 91+ file formats supported by Kreuzberg are available in WASM, with the exception that features requiring ONNX Runtime (layout detection) will fail gracefully with an unsupported error.
514
514
 
515
515
  ## Documentation
516
516
 
@@ -1791,7 +1791,7 @@ function __wbg_get_imports() {
1791
1791
  },
1792
1792
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
1793
1793
  // Cast intrinsic for `Closure(Closure { dtor_idx: 4, function: Function { arguments: [Externref], shim_idx: 5, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1794
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h716c2b336799e050, wasm_bindgen__convert__closures_____invoke__h41ca64df44699e38);
1794
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h4576f7e9900213fe, wasm_bindgen__convert__closures_____invoke__he779d3f2f70c5afe);
1795
1795
  return ret;
1796
1796
  },
1797
1797
  __wbindgen_cast_0000000000000003: function(arg0) {
@@ -1833,8 +1833,8 @@ function __wbg_get_imports() {
1833
1833
  };
1834
1834
  }
1835
1835
 
1836
- function wasm_bindgen__convert__closures_____invoke__h41ca64df44699e38(arg0, arg1, arg2) {
1837
- wasm.wasm_bindgen__convert__closures_____invoke__h41ca64df44699e38(arg0, arg1, arg2);
1836
+ function wasm_bindgen__convert__closures_____invoke__he779d3f2f70c5afe(arg0, arg1, arg2) {
1837
+ wasm.wasm_bindgen__convert__closures_____invoke__he779d3f2f70c5afe(arg0, arg1, arg2);
1838
1838
  }
1839
1839
 
1840
1840
  function wasm_bindgen__convert__closures_____invoke__h240eec0b57535315(arg0, arg1, arg2) {
@@ -1697,7 +1697,7 @@ export function __wbindgen_cast_0000000000000001(arg0, arg1) {
1697
1697
  }
1698
1698
  export function __wbindgen_cast_0000000000000002(arg0, arg1) {
1699
1699
  // Cast intrinsic for `Closure(Closure { dtor_idx: 4, function: Function { arguments: [Externref], shim_idx: 5, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1700
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h716c2b336799e050, wasm_bindgen__convert__closures_____invoke__h41ca64df44699e38);
1700
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h4576f7e9900213fe, wasm_bindgen__convert__closures_____invoke__he779d3f2f70c5afe);
1701
1701
  return ret;
1702
1702
  }
1703
1703
  export function __wbindgen_cast_0000000000000003(arg0) {
@@ -1730,8 +1730,8 @@ export function __wbindgen_init_externref_table() {
1730
1730
  table.set(offset + 2, true);
1731
1731
  table.set(offset + 3, false);
1732
1732
  }
1733
- function wasm_bindgen__convert__closures_____invoke__h41ca64df44699e38(arg0, arg1, arg2) {
1734
- wasm.wasm_bindgen__convert__closures_____invoke__h41ca64df44699e38(arg0, arg1, arg2);
1733
+ function wasm_bindgen__convert__closures_____invoke__he779d3f2f70c5afe(arg0, arg1, arg2) {
1734
+ wasm.wasm_bindgen__convert__closures_____invoke__he779d3f2f70c5afe(arg0, arg1, arg2);
1735
1735
  }
1736
1736
 
1737
1737
  function wasm_bindgen__convert__closures_____invoke__h240eec0b57535315(arg0, arg1, arg2) {
Binary file
@@ -46,10 +46,10 @@ export const write_block_from_callback_wasm: (a: number, b: number, c: number) =
46
46
  export const compress: (a: number, b: number, c: number, d: number) => [number, number, number];
47
47
  export const decompress: (a: any, b: number, c: number, d: any) => [number, number];
48
48
  export const wasm_bindgen__closure__destroy__hcbea9f36b367d3d8: (a: number, b: number) => void;
49
- export const wasm_bindgen__closure__destroy__h716c2b336799e050: (a: number, b: number) => void;
49
+ export const wasm_bindgen__closure__destroy__h4576f7e9900213fe: (a: number, b: number) => void;
50
50
  export const wasm_bindgen__convert__closures_____invoke__h240eec0b57535315: (a: number, b: number, c: any) => [number, number];
51
51
  export const wasm_bindgen__convert__closures_____invoke__h8e9fc28c4e841be2: (a: number, b: number, c: any, d: any) => void;
52
- export const wasm_bindgen__convert__closures_____invoke__h41ca64df44699e38: (a: number, b: number, c: any) => void;
52
+ export const wasm_bindgen__convert__closures_____invoke__he779d3f2f70c5afe: (a: number, b: number, c: any) => void;
53
53
  export const __wbindgen_externrefs: WebAssembly.Table;
54
54
  export const __wbindgen_malloc_command_export: (a: number, b: number) => number;
55
55
  export const __wbindgen_realloc_command_export: (a: number, b: number, c: number, d: number) => number;
package/package.json CHANGED
@@ -1,122 +1,124 @@
1
1
  {
2
- "name": "@kreuzberg/wasm",
3
- "version": "4.5.2",
4
- "type": "module",
5
- "packageManager": "pnpm@10.17.0",
6
- "description": "Kreuzberg document intelligence - WebAssembly bindings",
7
- "author": {
8
- "name": "Na'aman Hirschfeld",
9
- "email": "naaman@kreuzberg.dev",
10
- "url": "https://kreuzberg.dev"
11
- },
12
- "homepage": "https://kreuzberg.dev",
13
- "bugs": {
14
- "url": "https://github.com/kreuzberg-dev/kreuzberg/issues"
15
- },
16
- "main": "dist/index.js",
17
- "module": "dist/index.js",
18
- "types": "dist/index.d.ts",
19
- "exports": {
20
- ".": {
21
- "types": "./dist/index.d.ts",
22
- "import": "./dist/index.js",
23
- "default": "./dist/index.js"
24
- },
25
- "./dist/pkg/*": "./dist/pkg/*",
26
- "./dist/kreuzberg_wasm.js": "./dist/kreuzberg_wasm.js",
27
- "./kreuzberg_wasm_bg.wasm": "./dist/pkg/kreuzberg_wasm_bg.wasm",
28
- "./runtime": {
29
- "types": "./dist/runtime.d.ts",
30
- "import": "./dist/runtime.js",
31
- "default": "./dist/runtime.js"
32
- },
33
- "./adapters/wasm-adapter": {
34
- "types": "./dist/adapters/wasm-adapter.d.ts",
35
- "import": "./dist/adapters/wasm-adapter.js",
36
- "default": "./dist/adapters/wasm-adapter.js"
37
- },
38
- "./ocr/registry": {
39
- "types": "./dist/ocr/registry.d.ts",
40
- "import": "./dist/ocr/registry.js",
41
- "default": "./dist/ocr/registry.js"
42
- },
43
- "./ocr/tesseract-wasm-backend": {
44
- "types": "./dist/ocr/tesseract-wasm-backend.d.ts",
45
- "import": "./dist/ocr/tesseract-wasm-backend.js",
46
- "default": "./dist/ocr/tesseract-wasm-backend.js"
47
- }
48
- },
49
- "repository": {
50
- "type": "git",
51
- "url": "https://github.com/kreuzberg-dev/kreuzberg.git"
52
- },
53
- "license": "MIT",
54
- "keywords": [
55
- "wasm",
56
- "webassembly",
57
- "document-intelligence",
58
- "document-extraction",
59
- "text-extraction",
60
- "pdf-extraction",
61
- "ocr",
62
- "pdf",
63
- "docx",
64
- "xlsx",
65
- "pptx",
66
- "office-documents",
67
- "table-extraction",
68
- "metadata-extraction",
69
- "rust",
70
- "binding",
71
- "typescript"
72
- ],
73
- "files": [
74
- "dist",
75
- "pkg",
76
- "*.wasm",
77
- "*.d.ts",
78
- "README.md"
79
- ],
80
- "engines": {
81
- "node": ">= 16"
82
- },
83
- "publishConfig": {
84
- "registry": "https://registry.npmjs.org/",
85
- "access": "public"
86
- },
87
- "scripts": {
88
- "build:wasm:web": "wasm-pack build --target web --out-dir pkg --release -- --features ocr-wasm",
89
- "build:wasm:bundler": "wasm-pack build --target bundler --out-dir pkg --release -- --features ocr-wasm",
90
- "build:wasm:nodejs": "wasm-pack build --target nodejs --out-dir pkg-nodejs --release -- --features ocr-wasm",
91
- "build:wasm:deno": "wasm-pack build --target deno --out-dir pkg --release -- --features ocr-wasm",
92
- "build:ts": "tsup && tsc --emitDeclarationOnly && node scripts/fix-type-exports.js",
93
- "build:ts:minify": "tsup --minify && tsc --emitDeclarationOnly && node scripts/fix-type-exports.js",
94
- "fix:wasi": "node scripts/fix-wasi-imports.js",
95
- "copy:pkg": "node scripts/copy-pkg.js",
96
- "build": "npm run build:wasm:web && npm run fix:wasi && npm run build:ts && npm run copy:pkg",
97
- "build:ci": "npm run build:wasm:web && npm run fix:wasi && npm run build:ts:minify && npm run copy:pkg",
98
- "build:all": "npm run build:wasm:web && npm run build:wasm:bundler && npm run build:wasm:nodejs && npm run build:wasm:deno && npm run fix:wasi && npm run build:ts && npm run copy:pkg",
99
- "typecheck": "tsc --noEmit",
100
- "lint": "biome check typescript && oxlint typescript",
101
- "lint:fix": "biome check --write typescript",
102
- "format": "biome format --write typescript",
103
- "test": "vitest run",
104
- "test:watch": "vitest",
105
- "test:coverage": "vitest run --coverage",
106
- "test:ui": "vitest --ui",
107
- "prepublishOnly": "npm run build"
108
- },
109
- "devDependencies": {
110
- "@types/node": "^25.5.0",
111
- "@vitest/coverage-v8": "^4.1.0",
112
- "@vitest/ui": "^4.1.0",
113
- "jsdom": "^29.0.1",
114
- "oxlint": "^1.56.0",
115
- "tsup": "^8.5.1",
116
- "typescript": "^5.9.3",
117
- "vitest": "^4.1.0"
118
- },
119
- "optionalDependencies": {
120
- "tesseract-wasm": "^0.11.0"
121
- }
2
+ "name": "@kreuzberg/wasm",
3
+ "version": "4.5.4",
4
+ "type": "module",
5
+ "packageManager": "pnpm@10.17.0",
6
+ "description": "Kreuzberg document intelligence - WebAssembly bindings",
7
+ "author": {
8
+ "name": "Na'aman Hirschfeld",
9
+ "email": "naaman@kreuzberg.dev",
10
+ "url": "https://kreuzberg.dev"
11
+ },
12
+ "homepage": "https://kreuzberg.dev",
13
+ "bugs": {
14
+ "url": "https://github.com/kreuzberg-dev/kreuzberg/issues"
15
+ },
16
+ "main": "dist/index.js",
17
+ "module": "dist/index.js",
18
+ "types": "dist/index.d.ts",
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/index.d.ts",
22
+ "import": "./dist/index.js",
23
+ "default": "./dist/index.js"
24
+ },
25
+ "./dist/pkg/*": "./dist/pkg/*",
26
+ "./dist/kreuzberg_wasm.js": "./dist/kreuzberg_wasm.js",
27
+ "./kreuzberg_wasm_bg.wasm": "./dist/pkg/kreuzberg_wasm_bg.wasm",
28
+ "./pkg/kreuzberg_wasm.js": "./dist/pkg/kreuzberg_wasm.js",
29
+ "./pkg/kreuzberg_wasm_bg.wasm": "./dist/pkg/kreuzberg_wasm_bg.wasm",
30
+ "./runtime": {
31
+ "types": "./dist/runtime.d.ts",
32
+ "import": "./dist/runtime.js",
33
+ "default": "./dist/runtime.js"
34
+ },
35
+ "./adapters/wasm-adapter": {
36
+ "types": "./dist/adapters/wasm-adapter.d.ts",
37
+ "import": "./dist/adapters/wasm-adapter.js",
38
+ "default": "./dist/adapters/wasm-adapter.js"
39
+ },
40
+ "./ocr/registry": {
41
+ "types": "./dist/ocr/registry.d.ts",
42
+ "import": "./dist/ocr/registry.js",
43
+ "default": "./dist/ocr/registry.js"
44
+ },
45
+ "./ocr/tesseract-wasm-backend": {
46
+ "types": "./dist/ocr/tesseract-wasm-backend.d.ts",
47
+ "import": "./dist/ocr/tesseract-wasm-backend.js",
48
+ "default": "./dist/ocr/tesseract-wasm-backend.js"
49
+ }
50
+ },
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "https://github.com/kreuzberg-dev/kreuzberg.git"
54
+ },
55
+ "license": "MIT",
56
+ "keywords": [
57
+ "wasm",
58
+ "webassembly",
59
+ "document-intelligence",
60
+ "document-extraction",
61
+ "text-extraction",
62
+ "pdf-extraction",
63
+ "ocr",
64
+ "pdf",
65
+ "docx",
66
+ "xlsx",
67
+ "pptx",
68
+ "office-documents",
69
+ "table-extraction",
70
+ "metadata-extraction",
71
+ "rust",
72
+ "binding",
73
+ "typescript"
74
+ ],
75
+ "files": [
76
+ "dist",
77
+ "pkg",
78
+ "*.wasm",
79
+ "*.d.ts",
80
+ "README.md"
81
+ ],
82
+ "engines": {
83
+ "node": ">= 16"
84
+ },
85
+ "publishConfig": {
86
+ "registry": "https://registry.npmjs.org/",
87
+ "access": "public"
88
+ },
89
+ "scripts": {
90
+ "build:wasm:web": "wasm-pack build --target web --out-dir pkg --release -- --features ocr-wasm",
91
+ "build:wasm:bundler": "wasm-pack build --target bundler --out-dir pkg --release -- --features ocr-wasm",
92
+ "build:wasm:nodejs": "wasm-pack build --target nodejs --out-dir pkg-nodejs --release -- --features ocr-wasm",
93
+ "build:wasm:deno": "wasm-pack build --target deno --out-dir pkg --release -- --features ocr-wasm",
94
+ "build:ts": "tsup && tsc --emitDeclarationOnly && node scripts/fix-type-exports.js",
95
+ "build:ts:minify": "tsup --minify && tsc --emitDeclarationOnly && node scripts/fix-type-exports.js",
96
+ "fix:wasi": "node scripts/fix-wasi-imports.js",
97
+ "copy:pkg": "node scripts/copy-pkg.js",
98
+ "build": "npm run build:wasm:web && npm run fix:wasi && npm run build:ts && npm run copy:pkg",
99
+ "build:ci": "npm run build:wasm:web && npm run fix:wasi && npm run build:ts:minify && npm run copy:pkg",
100
+ "build:all": "npm run build:wasm:web && npm run build:wasm:bundler && npm run build:wasm:nodejs && npm run build:wasm:deno && npm run fix:wasi && npm run build:ts && npm run copy:pkg",
101
+ "typecheck": "tsc --noEmit",
102
+ "lint": "biome check typescript && oxlint typescript",
103
+ "lint:fix": "biome check --write typescript",
104
+ "format": "biome format --write typescript",
105
+ "test": "vitest run",
106
+ "test:watch": "vitest",
107
+ "test:coverage": "vitest run --coverage",
108
+ "test:ui": "vitest --ui",
109
+ "prepublishOnly": "npm run build"
110
+ },
111
+ "devDependencies": {
112
+ "@types/node": "^25.5.0",
113
+ "@vitest/coverage-v8": "^4.1.0",
114
+ "@vitest/ui": "^4.1.0",
115
+ "jsdom": "^29.0.1",
116
+ "oxlint": "^1.56.0",
117
+ "tsup": "^8.5.1",
118
+ "typescript": "^5.9.3",
119
+ "vitest": "^4.1.0"
120
+ },
121
+ "optionalDependencies": {
122
+ "tesseract-wasm": "^0.11.0"
123
+ }
122
124
  }