1[package]
2authors = ["Nathan Sobo <nathan@github.com>", "Yinan Long <lynweklm@gmail.com>"]
3description = "N-API bindings"
4edition = "2021"
5keywords = ["NodeJS", "Node", "FFI", "NAPI", "n-api"]
6license = "MIT"
7name = "napi"
8readme = "README.md"
9repository = "https://github.com/napi-rs/napi-rs"
10rust-version = "1.65"
11version = "2.16.0"
12
13[lib]
14doctest = false
15
16[package.metadata.docs.rs]
17all-features = true
18
19[package.metadata.workspaces]
20independent = true
21
22[features]
23async = ["tokio_rt"]
24chrono_date = ["chrono", "napi5"]
25compat-mode = []
26default = ["napi3", "compat-mode"] # for most Node.js users
27deferred_trace = ["napi4"]
28error_anyhow = ["anyhow"]
29experimental = ["napi-sys/experimental"]
30full = ["latin1", "napi9", "async", "serde-json", "experimental", "chrono_date"]
31object_indexmap = ["indexmap"]
32latin1 = ["encoding_rs"]
33napi1 = []
34napi2 = ["napi1", "napi-sys/napi2"]
35napi3 = ["napi2", "napi-sys/napi3"]
36napi4 = ["napi3", "napi-sys/napi4"]
37napi5 = ["napi4", "napi-sys/napi5"]
38napi6 = ["napi5", "napi-sys/napi6"]
39napi7 = ["napi6", "napi-sys/napi7"]
40napi8 = ["napi7", "napi-sys/napi8"]
41napi9 = ["napi8", "napi-sys/napi9"]
42noop = []
43serde-json = ["serde", "serde_json"]
44serde-json-ordered = ["serde-json", "serde_json/preserve_order"]
45tokio_fs = ["tokio/fs"]
46tokio_full = ["tokio/full"]
47tokio_io_std = ["tokio/io-std"]
48tokio_io_util = ["tokio/io-util"]
49tokio_macros = ["tokio/macros"]
50tokio_net = ["tokio/net"]
51tokio_process = ["tokio/process"]
52tokio_rt = ["tokio", "napi4"]
53tokio_signal = ["tokio/signal"]
54tokio_stats = ["tokio/stats"]
55tokio_sync = ["tokio/sync"]
56tokio_test_util = ["tokio/test-util"]
57tokio_time = ["tokio/time"]
58
59[dependencies]
60bitflags = "2"
61ctor = "0.2"
62once_cell = "1.19"
63
64[dependencies.anyhow]
65optional = true
66version = "1"
67
68[dependencies.napi-sys]
69path = "../sys"
70version = "2.3.0"
71
72[dependencies.encoding_rs]
73optional = true
74version = "0.8"
75
76[dependencies.chrono]
77optional = true
78version = "0.4"
79
80[target.'cfg(target_family = "wasm")'.dependencies]
81napi-derive = { path = "../macro", version = "2.10.1", default-features = false }
82tokio = { version = "1", optional = true, features = ["rt", "sync"] }
83
84[target.'cfg(not(target_family = "wasm"))'.dependencies]
85tokio = { version = "1", optional = true, features = [
86 "rt",
87 "rt-multi-thread",
88 "sync",
89] }
90
91[dependencies.serde]
92optional = true
93version = "1"
94
95[dependencies.serde_json]
96optional = true
97version = "1"
98
99[dependencies.indexmap]
100optional = true
101version = "2"
102