neon-testing/native/src/lib.rs

13 行
219 B
Rust

#[macro_use]
extern crate neon;
use neon::prelude::*;
fn hello(mut cx: FunctionContext) -> JsResult<JsString> {
Ok(cx.string("hello node"))
}
register_module!(mut cx, {
cx.export_function("hello", hello)
});