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