-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCargo.toml
More file actions
50 lines (46 loc) · 2.05 KB
/
Copy pathCargo.toml
File metadata and controls
50 lines (46 loc) · 2.05 KB
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
# Node.js / Bun bindings for docling.rs, built with napi-rs.
#
# Produces a native N-API addon (`.node`) that loads in both Node.js and Bun
# (Bun implements N-API). The TypeScript surface mirrors the Rust
# `DocumentConverter`: convert a file or in-memory bytes to Markdown or docling
# JSON, with the same knobs (strict Markdown, image modes, allowed formats,
# external image fetching) plus incremental Markdown streaming.
#
# This crate is intentionally kept OUT of the default workspace members' publish
# flow (it ships to npm, not crates.io). It is a `cdylib` — the only artifact is
# the addon, there is no Rust library API here.
[package]
name = "docling-node"
description = "Node.js / Bun bindings for docling.rs (a Rust port of docling)."
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
readme = "README.md"
rust-version.workspace = true
# Not a crates.io library — the deliverable is the npm package.
publish = false
[lib]
# napi addons are C-ABI dynamic libraries loaded by the JS runtime.
crate-type = ["cdylib"]
[dependencies]
# `chunking` pulls in the HF-tokenizer-backed HybridChunker for the chunk* API.
docling = { path = "../docling", version = "0.52.0", features = ["chunking"] }
# Node-API bindings. `napi4` enables threadsafe functions, used for streaming.
napi = { version = "2", default-features = false, features = ["napi4"] }
napi-derive = "2"
[build-dependencies]
napi-build = "2"
[features]
# GPU execution providers (#74) — pass-through to the docling crate, same as
# the CLI/serve/py surfaces. Build with `npm run build:cuda` (or
# `napi build ... --features cuda`); which provider actually runs is chosen
# at startup via DOCLING_RS_EP (a GPU build defaults to `auto`: GPU when
# usable, CPU fallback). The CUDA/TensorRT provider dylibs land next to the
# addon in target/ (ort's copy-dylibs) and must ship next to the `.node`
# file — see README "GPU (CUDA)".
cuda = ["docling/cuda"]
tensorrt = ["docling/tensorrt"]
directml = ["docling/directml"]
coreml = ["docling/coreml"]