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.17"
12
13[lib]
14doctest = false
15
16[package.metadata.docs.rs]
17all-features = true
18rustdoc-args = ["--cfg", "docsrs"]
19
20[package.metadata.workspaces]
21independent = true
22
23[features]
24async = ["tokio_rt"]
25chrono_date = ["chrono", "napi5"]
26compat-mode = []
27default = ["napi3", "compat-mode"] # for most Node.js users
28deferred_trace = ["napi4"]
29error_anyhow = ["anyhow"]
30experimental = ["napi-sys/experimental"]
31full = ["latin1", "napi9", "async", "serde-json", "experimental", "chrono_date"]
32object_indexmap = ["indexmap"]
33latin1 = ["encoding_rs"]
34napi1 = []
35napi2 = ["napi1", "napi-sys/napi2"]
36napi3 = ["napi2", "napi-sys/napi3"]
37napi4 = ["napi3", "napi-sys/napi4"]
38napi5 = ["napi4", "napi-sys/napi5"]
39napi6 = ["napi5", "napi-sys/napi6"]
40napi7 = ["napi6", "napi-sys/napi7"]
41napi8 = ["napi7", "napi-sys/napi8"]
42napi9 = ["napi8", "napi-sys/napi9"]
43noop = []
44serde-json = ["serde", "serde_json"]
45serde-json-ordered = ["serde-json", "serde_json/preserve_order"]
46tokio_fs = ["tokio/fs"]
47tokio_full = ["tokio/full"]
48tokio_io_std = ["tokio/io-std"]
49tokio_io_util = ["tokio/io-util"]
50tokio_macros = ["tokio/macros"]
51tokio_net = ["tokio/net"]
52tokio_process = ["tokio/process"]
53tokio_rt = ["tokio", "napi4"]
54tokio_signal = ["tokio/signal"]
55tokio_sync = ["tokio/sync"]
56tokio_test_util = ["tokio/test-util"]
57tokio_time = ["tokio/time"]
58dyn-symbols = ["napi-sys/dyn-symbols"]
59
60[dependencies]
61bitflags = "2"
62ctor = "0.2"
63once_cell = "1.19"
64
65[dependencies.anyhow]
66optional = true
67version = "1"
68
69[dependencies.napi-sys]
70path = "../sys"
71version = "2.4.0"
72
73[dependencies.encoding_rs]
74optional = true
75version = "0.8"
76
77[dependencies.chrono]
78optional = true
79version = "0.4"
80
81[target.'cfg(target_family = "wasm")'.dependencies]
82napi-derive = { path = "../macro", version = "2.10.1", default-features = false }
83tokio = { version = "1", optional = true, features = ["rt", "sync"] }
84
85[target.'cfg(not(target_family = "wasm"))'.dependencies]
86tokio = { version = "1", optional = true, features = [
87 "rt",
88 "rt-multi-thread",
89 "sync",
90] }
91
92[dependencies.serde]
93optional = true
94version = "1"
95
96[dependencies.serde_json]
97optional = true
98version = "1"
99
100[dependencies.indexmap]
101optional = true
102version = "2"
103