mirror of
https://github.com/napi-rs/napi-rs.git
synced 2025-12-08 19:56:07 +00:00
1. inline everything 2. change `check_status` and `type_of` to macro 3. provide #[module_exports] macro 4. remove debug and repr[transparent] for ffi struct
19 lines
322 B
Rust
19 lines
322 B
Rust
#[macro_use]
|
|
extern crate napi_derive;
|
|
|
|
use napi::{JsObject, Result};
|
|
|
|
mod async_compute;
|
|
mod noop;
|
|
mod plus;
|
|
|
|
#[module_exports]
|
|
fn init(mut exports: JsObject) -> Result<()> {
|
|
exports.create_named_method("noop", noop::noop)?;
|
|
|
|
async_compute::register_js(&mut exports)?;
|
|
plus::register_js(&mut exports)?;
|
|
|
|
Ok(())
|
|
}
|