35 releases

Uses old Rust 2015

0.5.0 Oct 12, 2020
0.4.0 Feb 14, 2020
0.3.3 Oct 22, 2019
0.2.0 Jul 25, 2018
0.1.1 Dec 28, 2015
Download history 3298/week @ 2020-06-30 2270/week @ 2020-07-07 2566/week @ 2020-07-14 2623/week @ 2020-07-21 3492/week @ 2020-07-28 3339/week @ 2020-08-04 3264/week @ 2020-08-11 3052/week @ 2020-08-18 3301/week @ 2020-08-25 1473/week @ 2020-09-01 1765/week @ 2020-09-08 1331/week @ 2020-09-15 4350/week @ 2020-09-22 5358/week @ 2020-09-29 5452/week @ 2020-10-06 4780/week @ 2020-10-13

13,600 downloads per month
Used in 2 crates

MIT/Apache

280KB
6K SLoC

Rust 3.5K SLoC // 0.0% comments TypeScript 1.5K SLoC // 0.0% comments JavaScript 1K SLoC // 0.0% comments Shell 141 SLoC // 0.1% comments Handlebars 78 SLoC
neon

Cargo npm Linux Build Status macOS Build Status Windows Build Status

Rust bindings for writing safe and fast native Node.js modules.

Getting started

Once you have the platform dependencies installed, getting started is as simple as:

$ npm install -g neon-cli
$ neon new my-project

Then see the Hello World guide for writing your first Hello World in Neon!

Docs

See our Neon fundamentals docs and our API docs.

Platform Support

Operating Systems

Linux macOS Windows

Node.js

Node 10 Node 12 Node 14

Support for LTS versions of Node and current are expected. If you're using a different version of Node and believe it should be supported, let us know.

Rust

Neon supports Rust stable version 1.18 and higher. We test on the latest stable, beta, and nightly versions of Rust.

A Taste...

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)
}

register_module!(mut cx, {
    cx.export_function("makeAnArray", make_an_array)
})

For more examples, see our examples repo.

Get Involved

The Neon community is just getting started and there's tons of fun to be had. Come play! :)

The Rust Bindings community Slack is open to all; use the Slackin app to receive an invitation.

License

Licensed under either of

at your option.

Dependencies