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. | publishing modules | Using node-pre-gyp to build and publish binaries for multiple platforms |
18. | event emitter | An example of creating an EventEmitter with Neon |
19. | Bindgen | Planned |
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