Registry / other / napi
library3.9.2rscratesunverified

N-API bindings for building native Node.js addons with Rust.

# Cargo.toml [dependencies] napi = "3.9.2"
INSTALL
IMPORT
SIG · NAPI
N
napi
otherrustv3.9.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

napi
use napi::bindgen_prelude::*;

Exports a simple add function to Node.js via N-API.

use napi::bindgen_prelude::*; #[napi] fn add(a: i32, b: i32) -> i32 { a + b }
Debug
Known issues
gotchaRequires the `napi` feature flag for full functionality.
fix
Add `napi = { version = "3", features = ["napi4"] }` to Cargo.toml.
affects: >=3.0.0
Upgrade
Version history
3.9.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
napi — cargo add napi · libregistry