// JS
function hello() {
  let result = fibonacci(10000);
  console.log(result);
  return result;
}

// Neon
fn hello(mut cx: FunctionContext) -> JsResult<JsNumber> {
  let result = cx.number(fibonacci(10000));
  println!("{}", result);
  Ok(result)
}

Features

[object Object]Simple Tooling

No makefiles. No fancy global build requirements. Just Node and Rust

[object Object]Guaranteed Safety

If a neon module compiles, it is guaranteed to be memory safe by the rust compiler

[object Object]Easy Parallelism

Safely run multiple threads without data races

Examples


// Create an array and add some values to it
fn make_an_array(mut cx: FunctionContext) -> JsResult<JsArray> {
  // Create some values:
  let n = cx.number(9000);
  let s = cx.string("hello");
  let b = cx.boolean(true);
  // Create a new array:
  let array: Handle<JsArray> = cx.empty_array();
  // Push the values into the array:
  array.set(&mut cx, 0, n)?;
  array.set(&mut cx, 1, s)?;
  array.set(&mut cx, 2, b)?;
  // Return the array:
  Ok(array)
}

Demo