Cargo Features
[dependencies]
neon = { version = "1.1.0-alpha.1", default-features = false, features = ["serde", "external-buffers", "futures", "sys", "tokio", "tokio-rt", "tokio-rt-multi-thread", "napi-runtime", "napi-1", "napi-2", "napi-3", "napi-4", "napi-5", "napi-6", "napi-7", "napi-8", "napi-experimental", "doc-dependencies"] }
- default = napi-8
-
The
napi-8
feature is set by default wheneverneon
is added without
somewhere in the dependency tree.default-features = false - serde
-
Enable extracting values by serializing to JSON
Enables serde and serde_json
Affects
macro_internal::NeonJsonTag
,extract::json
… - external-buffers
-
Enable the creation of external binary buffers. This is disabled by default since these APIs fail at runtime in environments that enable the V8 memory cage (such as Electron: https://www.electronjs.org/blog/v8-memory-cage).
Affects
arraybuffer::new_external
,buffer::new_external
… - futures tokio-rt?
-
Experimental Rust Futures API https://github.com/neon-bindings/rfcs/pull/46
Enables tokio
Affects
promise::JsFuture
… - sys
-
Enable low-level system APIs. The
sys
API allows augmenting the Neon API from external crates.Affects
context::SysContext
,context::Context.to_raw
,neon::sys
,types_impl::Value.to_raw
,types_impl::Value.from_raw
… - tokio tokio-rt? tokio-rt-multi-thread? = tokio-rt-multi-thread
-
Enable async runtime
Shorter alias - tokio-rt tokio-rt-multi-thread? = futures
-
tokio:
Includes basic task execution capabilities
- tokio-rt-multi-thread tokio? = tokio-rt
-
Enables rt-multi-thread of tokio
- napi-runtime = napi-8
-
Default N-API version. Prefer to select a minimum required version.
DEPRECATED: This is an alias that should be removed - napi-1 napi-2?
-
Select the N-API version Feature flags to enable the experimental N-API runtime. For now, this feature is disabled by default. The Node N-API documentation specifies N-API and Node version requirements https://nodejs.org/api/n-api.html
- napi-2 napi-3? = napi-1
- napi-3 napi-4? = napi-2
- napi-4 napi-5? = napi-3
-
Affects
context::Context.queue
,context::Context.channel
,event::EventQueue
,event::EventQueueError
,types::ThreadsafeFunction__
,types::ThreadsafeFunction
,types::ThreadsafeFunctionCallJs
,types::ThreadsafeFunctionCallMode
,types::ThreadsafeFunctionReleaseMode
… - napi-5 napi-6? = napi-4
-
Affects
context::Context.date
,tag::is_date
,extract::Date
,promise::JsFuture
… - napi-6 napi-7? = napi-5
-
Affects
neon::thread
,object::Object.get_own_property_names
,types::KeyCollectionMode
,types::KeyConversion
,types::KeyFilter
,object::get_own_property_names
,promise::reject_err_message
,tag::is_bigint
,types_impl::bigint
,types_impl::JsBigInt
… - napi-7 napi-8 = napi-6
- napi-8 default napi-experimental? napi-latest? napi-runtime? = getrandom, napi-7
-
Affects
object::Object.freeze
,object::Object.seal
,types::TypeTag
,object::freeze
,object::seal
,tag::type_tag_object
,tag::check_object_type_tag
… - napi-latest napi-experimental = napi-8
- doc-dependencies = aquamarine, doc-comment, easy-cast
-
Enables the optional dependencies that are only used for generating the API docs.
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.
- getrandom napi-8
- aquamarine doc-dependencies?
-
Enables aquamarine ^0.3.2
- easy-cast doc-dependencies?
-
Enables easy-cast
used for a doc example
- doc-comment doc-dependencies?