101个版本 (66个稳定版)

3.0.0-alpha.72024年7月23日
3.0.0-alpha.22024年6月27日
3.0.0-alpha.02024年3月20日
2.16.11 2024年8月10日
0.1.0 2017年11月30日

#596进程宏 中排名

Download history · Rust 包仓库 112397/week @ 2024-04-20 · Rust 包仓库 72847/week @ 2024-04-27 · Rust 包仓库 76394/week @ 2024-05-04 · Rust 包仓库 70564/week @ 2024-05-11 · Rust 包仓库 66032/week @ 2024-05-18 · Rust 包仓库 72268/week @ 2024-05-25 · Rust 包仓库 129680/week @ 2024-06-01 · Rust 包仓库 128456/week @ 2024-06-08 · Rust 包仓库 133161/week @ 2024-06-15 · Rust 包仓库 161384/week @ 2024-06-22 · Rust 包仓库 159782/week @ 2024-06-29 · Rust 包仓库 154871/week @ 2024-07-06 · Rust 包仓库 150736/week @ 2024-07-13 · Rust 包仓库 141383/week @ 2024-07-20 · Rust 包仓库 143002/week @ 2024-07-27 · Rust 包仓库 112248/week @ 2024-08-03 · Rust 包仓库

575,076 每月下载量
52 Crates使用 (40个直接使用)

MIT 许可证

180KB
5K SLoC

napi-derive

chat

examples 文件夹中查看更多示例

#[macro_use]
extern crate napi_derive;
use napi::bindgen_prelude::*;

#[napi]
fn fibonacci(n: u32) -> u32 {
  match n {
    1 | 2 => 1,
    _ => fibonacci_native(n - 1) + fibonacci_native(n - 2),
  }
}

#[napi]
fn get_cwd<T: Fn(String) -> Result<()>>(callback: T) {
  callback(env::current_dir().unwrap().to_string_lossy().to_string()).unwrap();
}

依赖

~0.9–1.9MB
~34K SLoC