napi-rs/examples/napi-compat-mode/src/napi_version.rs

7 lines
178 B
Rust
Raw Normal View History

use napi::{CallContext, JsNumber, Result};
#[js_function]
pub fn get_napi_version(ctx: CallContext) -> Result<JsNumber> {
ctx.env.create_uint32(ctx.env.get_napi_version()?)
}