@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.
- package/README.md +5 -5
- package/dist/index.js +36 -23
- package/dist/index.js.map +1 -1
- package/dist/initialization/wasm-loader.d.ts +14 -3
- package/dist/initialization/wasm-loader.d.ts.map +1 -1
- package/dist/pkg/README.md +5 -5
- package/dist/pkg/kreuzberg_wasm.js +3 -3
- package/dist/pkg/kreuzberg_wasm_bg.js +3 -3
- package/dist/pkg/kreuzberg_wasm_bg.wasm +0 -0
- package/dist/pkg/kreuzberg_wasm_bg.wasm.d.ts +2 -2
- package/package.json +122 -120
|
@@ -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
|
|
16
|
-
* the runtime cannot fetch `file://` URLs.
|
|
17
|
-
*
|
|
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
|
|
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"}
|
package/dist/pkg/README.md
CHANGED
|
@@ -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.
|
|
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
|
|
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 (
|
|
274
|
+
### Supported File Formats (91+)
|
|
275
275
|
|
|
276
|
-
|
|
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
|
|
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.
|
|
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
|
|
1837
|
-
wasm.
|
|
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.
|
|
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
|
|
1734
|
-
wasm.
|
|
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
|
|
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
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
}
|