21 releases

Uses old Rust 2015

new 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.13 Feb 20, 2017
Download history 3077/week @ 2020-06-25 3578/week @ 2020-07-02 2050/week @ 2020-07-09 3043/week @ 2020-07-16 3374/week @ 2020-07-23 3572/week @ 2020-07-30 3783/week @ 2020-08-06 3450/week @ 2020-08-13 3629/week @ 2020-08-20 2719/week @ 2020-08-27 1767/week @ 2020-09-03 1990/week @ 2020-09-10 2052/week @ 2020-09-17 5742/week @ 2020-09-24 5719/week @ 2020-10-01 4912/week @ 2020-10-08

14,828 downloads per month
Used in 3 crates (2 directly)

MIT/Apache

8KB
111 lines

neon

Travis Build Status Appveyor Build Status npm

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

~38KB