A collection of examples of Neon
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
__test__ add tests, remove metadata from Cargo.toml Dec 5, 2018
arguments add tests, remove metadata from Cargo.toml Dec 5, 2018
arrays add tests, remove metadata from Cargo.toml Dec 5, 2018
async change new install scripts in errors and modules to build release Dec 5, 2018
classes add async examples Dec 4, 2018
electron-app add lockfiles Dec 5, 2018
errors change new install scripts in errors and modules to build release Dec 5, 2018
fibonacci-task add async examples Dec 4, 2018
functions add tests, remove metadata from Cargo.toml Dec 5, 2018
hello-world add async examples Dec 4, 2018
json add tests, remove metadata from Cargo.toml Dec 5, 2018
modules change new install scripts in errors and modules to build release Dec 5, 2018
objects add tests, remove metadata from Cargo.toml Dec 5, 2018
primitives add tests, remove metadata from Cargo.toml Dec 5, 2018
sharing-binary-data add async examples Dec 4, 2018
thread-count add async examples Dec 4, 2018
word-counting add async examples Dec 4, 2018
.editorconfig first commit Nov 9, 2018
.eslintignore fix code style issues causing eslint to fail Nov 27, 2018
.gitignore remove yarn.lock files Nov 9, 2018
.travis.yml update setup instructions Nov 10, 2018
LICENSE Update LICENSE Dec 3, 2018
README.md add async examples Dec 4, 2018
lerna.json use consistent version numbers Nov 27, 2018
package-lock.json fix code style issues causing eslint to fail Nov 27, 2018
package.json add lockfiles Dec 5, 2018

README.md

neon-examples

Build Status

Table of Contents

Example Descrption
1. hello world Return a hello world string to Node
2. primitives Creating JS primitives in Rust
3. arrays Creating and using JS arrays in Rust
4. objects Creating and using JS objects in Rust
5. arguments Getting and checking function arguments
6. functions Creating and calling JS functions from Rust
7. classes Creating classes
8. modules Exporting functions, classes, and values
9. json Handling JSON passed between JS and Rust
10. errors Creating and throwing errors
11. async Creating and scheduling async background tasks in Node's thread pool
12. thread count Expose the num_cups Rust library to JS
13. fibonacci task Computing the nth fibonacci number in Rust and passing the result to JS
14. word counting A word counting demo in Rust and JS with benchmarks
15. sharing binary data Handling binary data passed from Node to Rust
16. electron app A simple electron app using Neon modules
17. Bindgen Planned

Setup

git clone https://github.com/neon-bindings/examples
cd neon-examples

# Compiling and running a single example:
cd primitives
npm install # OR `yarn`
node ./lib/index.js

# Compiling and running all the examples:
npm install -g lerna
lerna bootstrap
lerna run install
cd primitives
node ./lib/index.js