Cargo Features

neon = { version = "1.0.0-alpha.4", 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", "try-catch-api", "promise-api", "task-api", "proc-macros", "doc-dependencies"] }
default = napi-1

The napi-1 feature is set by default whenever neon is added without default-features = false somewhere in the dependency tree.


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:

Affects arraybuffer::new_external, buffer::new_external

futures = tokio

Experimental Rust Futures API

Affects promise::JsFuture


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 default 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

napi-2 napi-3? = napi-1
napi-3 napi-4? = napi-2
napi-4 napi-5? = napi-3

Affects context::Context.queue,, event::EventQueue, event::EventQueueError, types::ThreadsafeFunction__, types::ThreadsafeFunction, types::ThreadsafeFunctionCallJs, types::ThreadsafeFunctionCallMode, types::ThreadsafeFunctionReleaseMode

napi-5 napi-6? = napi-4

Affects, 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 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

DEPRECATED: These perform no action and will be removed in 1.0

channel-api event-queue-api promise-api

Feature flag to include procedural macros
DEPRECATED: This is always enabled and should be removed.

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.

getrandom napi-8?
aquamarine doc-dependencies?

Enables aquamarine ^0.1.11

easy-cast doc-dependencies?

With default (std)

doc-comment doc-dependencies?
tokio futures?

With sync