Re-exports

pub use crate::assert_type_of;
pub use crate::check_status;
pub use crate::check_status_or_throw;
pub use crate::error;
pub use crate::sys;
pub use crate::type_of;

Modules

Structs

https://nodejs.org/api/n-api.html#napi_create_bigint_words The resulting BigInt is calculated as: (–1)^sign_bit (words[0] × (2^64)^0 + words[1] × (2^64)^1 + …)

Zero copy u8 vector shared between rust and napi. Auto reference the raw JavaScript value, and release it when dropped. So it is safe to use it in async fn, the &[u8] under the hood will not be dropped until the drop called. Clone will create a new Reference to the same underlying JavaScript Buffer.

Env is used to represent a context that the underlying N-API implementation can use to persist VM-specific state.

Represent JsError. Return this Error in js_function, napi-rs will throw it as JsError for you. If you want throw it as TypeError or RangeError, you can use JsTypeError/JsRangeError::from(Error).throw_into(env)

Experimental feature

Experimental feature

i64 is converted to Number

Enums

Traits

Functions

Get C Callback from defined Rust fn

Get JsFunction from defined Rust fn

Type Definitions

Attribute Macros

Marks a function or static variable as a library/executable constructor. This uses OS-specific linker sections to call a specific function at load time.