[BREAKGLASS] Append-only mirror of github.com/signalapp/neon
Go to file
David Herman f75368a2d2 cargo fmt
2021-05-15 13:38:07 -07:00
.cargo chore(neon): Run all of the doc tests and run tests in debug mode 2021-04-28 15:41:08 -04:00
.github/workflows chore(neon): Drop support for Node 10 which is end of life 2021-04-30 12:43:07 -04:00
cli chore(cli): Suggest using create-neon instead 2021-05-15 09:54:39 -07:00
crates v0.8.1 2021-04-30 13:05:02 -04:00
create-neon v0.8.0 2021-03-22 10:07:52 -04:00
dev update branch name 2020-10-08 15:39:00 +02:00
src cargo fmt 2021-05-15 13:38:07 -07:00
test Rename EventQueue and EventQueueError to Channel and SendError. 2021-05-15 12:45:11 -07:00
.editorconfig run cli, static, and dynamic tests on CI, add tests for cache busting 2019-01-18 15:23:36 -08:00
.gitignore - Move test helpers into dev/ directory 2021-03-08 21:51:23 -08:00
AUTHORS.md v0.8.1 2021-04-30 13:05:02 -04:00
build.rs We didn't actually need the CI flag after all; just #[ignore] the static tests for all Rust versions except beta. 2019-09-30 13:23:39 -07:00
Cargo.toml Upgrade to Rust 2018 Edition 2021-05-14 11:25:31 -07:00
CODE_OF_CONDUCT.md Switching to the Contributor Covenant code of conduct. The Rust CoC is pretty good, but the CC CoC is a bit more polished and consistent, and also stated in a way that's less tied to one specific project. 2017-09-22 14:58:50 -07:00
CONTRIBUTING.md update rfcs main branch references 2020-10-08 15:47:17 +02:00
LICENSE-APACHE Move neon-cli files into cli subdirectory, and restore temporarily-moved neon files back to project root. 2017-09-17 23:26:08 -07:00
LICENSE-MIT Relicensing! Like Neon itself, the neon CLI is now dual-licensed under 2017-09-02 05:26:06 -07:00
MIGRATION_GUIDE.md v0.8.1 2021-04-30 13:05:02 -04:00
neon.png change image to png 2018-12-23 20:59:05 -08:00
README.md chore(cli): Suggest using create-neon instead 2021-05-15 09:54:39 -07:00
RELEASES.md v0.8.1 2021-04-30 13:05:02 -04:00

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 init neon my-project

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

Note: This will create a new project with the napi-backend and some documentation may not be up to date.

Docs

See our Neon fundamentals docs and our API docs.

N-API Migration Guide

We've ported Neon to a new backend based on N-API, which will be the basis for Neon 1.0.

Read the new migration guide to learn how to port your Neon projects to N-API!

Platform Support

Operating Systems

Linux macOS Windows

Node.js

Node 12 Node 14 Node 16

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.