Cargo Features

[dependencies]
napi = { version = "3.0.0-alpha.2", default-features = false, features = ["async", "chrono_date", "compat-mode", "full", "deferred_trace", "error_anyhow", "experimental", "object_indexmap", "latin1", "napi1", "napi2", "napi3", "napi4", "napi5", "napi6", "napi7", "napi8", "napi9", "noop", "serde-json", "serde-json-ordered", "tokio_fs", "tokio_full", "tokio_io_std", "tokio_io_util", "tokio_macros", "tokio_net", "tokio_process", "tokio_rt", "tokio_signal", "tokio_stats", "tokio_sync", "tokio_test_util", "tokio_time", "dyn-symbols"] }
async full? = tokio_rt
chrono_date full? = chrono, napi5
compat-mode default

Affects module_register::register_module_exports

default = compat-mode, napi3

for most Node.js users

full = async, chrono_date, experimental, latin1, napi9, serde-json
deferred_trace = napi4
error_anyhow = anyhow
experimental full?

Enables experimental of napi-sys

object_indexmap = indexmap
latin1 full? = encoding_rs

Affects string::latin1_string

napi1 napi2?
napi2 napi3 = napi1

Enables napi2 of napi-sys

napi3 default napi4? = napi2

Enables napi3 of napi-sys

napi4 deferred_trace? napi5? tokio_rt? = napi3

Enables napi4 of napi-sys

Affects function::ThreadsafeFunctionBuilder, napi::threadsafe_function

napi5 chrono_date? napi6? = napi4

Enables napi5 of napi-sys

Affects object::FinalizeContext, object_property::PropertyClosures

napi6 napi7? = napi5

Enables napi6 of napi-sys

Affects object::KeyCollectionMode, object::KeyFilter, object::KeyConversion

napi7 napi8? = napi6

Enables napi7 of napi-sys

napi8 napi9? = napi7

Enables napi8 of napi-sys

napi9 full? = napi8

Enables napi9 of napi-sys

Affects error::JsSyntaxError

noop
serde-json full? serde-json-ordered? = serde, serde_json
serde-json-ordered = serde-json

Enables preserve_order of serde_json

serde_json:

Make serde_json::Map use a representation which maintains insertion order.
This allows data to be read into a Value and written back to a JSON string while preserving the order of map keys in the input.

tokio_fs

Enables fs of tokio

tokio_full

Enables full of tokio

tokio:

enable everything

tokio_io_std

Enables io-std of tokio

tokio:

stdin, stdout, stderr

tokio_io_util

Enables io-util of tokio

tokio_macros

Enables macros of tokio

tokio_net

Enables net of tokio

tokio_process

Enables process of tokio

tokio_rt async? = napi4, tokio
tokio_signal

Enables signal of tokio

tokio_stats

Enables stats of tokio

tokio_sync

Enables tokio

tokio_test_util

Enables test-util of tokio

tokio_time

Enables time of tokio

dyn-symbols

Enables dyn-symbols of napi-sys

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

anyhow error_anyhow?
chrono chrono_date?
encoding_rs latin1?
indexmap object_indexmap?
serde serde-json?
serde_json serde-json? serde-json-ordered?
tokio not wasm wasm tokio_fs? tokio_full? tokio_io_std? tokio_io_util? tokio_macros? tokio_net? tokio_process? tokio_rt? tokio_signal? tokio_stats? tokio_sync? tokio_test_util? tokio_time?