napi-derive

chat

Checkout more examples in examples folder

```rust

[macro_use]

extern crate napiderive; use napi::bindgenprelude::*;

[napi]

fn fibonacci(n: u32) -> u32 { match n { 1 | 2 => 1, _ => fibonaccinative(n - 1) + fibonaccinative(n - 2), } }

[napi]

fn getcwd Result<()>>(callback: T) { callback(env::currentdir().unwrap().tostringlossy().to_string()).unwrap(); } ```