Cargo Features

[dependencies]
neon = { version = "1.0.0", default-features = false, features = ["external-buffers", "futures", "sys", "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 whenever neon is added without default-features = false somewhere in the dependency tree.

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

Experimental Rust Futures API https://github.com/neon-bindings/rfcs/pull/46

Affects promise::JsFuture

sys

Enable low-level system APIs. The sys API allows augmenting the Neon API from external crates.

Affects context::Context.to_raw, context::SysContext, neon::sys, types_impl::Value.to_raw, types_impl::Value.from_raw

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, 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?
doc-comment doc-dependencies?
tokio futures?