This is an example Node.js addon with several functions written in C++.
It demonstrates using nbind to easily define an API for the addon and autogypi to prepare the project for compiling.
You need one of the following C++ compilers to install it:
- GCC 4.8 or above
- Clang 3.6 or above
- Visual Studio 2015 (The Community version is fine)
First install:
git clone https://github.com/charto/nbind-examples.git
cd nbind-examples
npm install
Then run individual examples:
node 0-hello.js
node 1-headers.js
node 2-classes.js
node 3-methods.js
node 4-getset.js
node 5-objects.js
These examples are public domain.