neon-testing/native/src/lib.rs

13 行
219 B
Rust

2018-12-18 21:49:39 +00:00
#[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)
});