napi-async-runtime 0.2.7

Shared pluggable async runtime for napi-rs addons: a tokio-free async/CPU/blocking scheduler plus an optional napi AsyncRuntime SPI adapter
Documentation
[package]
authors = ["LongYinan <lynweklm@gmail.com>"]
description = "Shared pluggable async runtime for napi-rs addons: a tokio-free async/CPU/blocking scheduler plus an optional napi AsyncRuntime SPI adapter"
edition = "2024"
keywords = ["NodeJS", "Node", "async", "runtime", "NAPI"]
license = "MIT"
name = "napi-async-runtime"
readme = "README.md"
repository = "https://github.com/napi-rs/napi-rs"
rust-version.workspace = true
version = "0.2.7"

[features]
default = ["napi"]
napi = ["dep:napi", "dep:napi-derive"]

[dependencies]
arc-swap = "1"
async-task = "4.7.1"
futures = "0.3"
rustc-hash = "2"

[dependencies.napi]
path = "../napi"
version = "3.15.0"
default-features = false
features = ["napi4", "async-runtime"]
optional = true

[dependencies.napi-derive]
path = "../macro"
version = "3.6.13"
default-features = false
features = ["type-def"]
optional = true

[target.'cfg(not(target_family = "wasm"))'.dependencies]
rayon = "1.12"
crossbeam-deque = "0.8"

# Cargo resolves target tables from `rustc --print cfg`, which is IDENTICAL for
# the two WASI targets (see build.rs), so no `cfg()` table can name the threads
# triple. The exact triple is the only spelling that gives it rayon without
# dragging rayon into the threadless `wasm32-wasip1` artifact.
#
# napi-sys holds the memory-size state that napi's allocator lock and this
# crate's scheduler handoffs share (`napi_sys::wasi_heap_sync`). It depends on
# neither napi nor this crate, so there is no cycle, and that module defines
# and imports no symbol, so the napi-free test binary still links under a bare
# WASI host.
[target.wasm32-wasip1-threads.dependencies]
rayon = "1.12"
crossbeam-deque = "0.8"
napi-sys = { path = "../sys", version = "3.4.1", default-features = false }

# The in-crate test binaries are plain executables rather than Node-loaded
# cdylibs; `dyn-symbols` resolves Node-API symbols at runtime so those
# binaries can link. Shipped builds keep the minimal feature set above.
# wasm test binaries run under a bare WASI host with no Node-API at all and
# never reference this crate, so it is excluded there rather than compiled and
# then dropped by the linker.
[target.'cfg(not(target_family = "wasm"))'.dev-dependencies]
napi = { path = "../napi", version = "3.15.0", default-features = false, features = [
  "dyn-symbols",
] }