This is a simple example to show how to generate a node project that includes given addon code.
The binding.gyp declares two targets, hello and greet.
- hello: just a simple C++ function that returns the string
"world" - greet: wraps the C library
./deps/greeterwhich takes anameto return"hello <name>"
To play with this, do the following (assuming you have nad installed).
git clone https://github.com/thlorenz/nad && cd nad/example
nad build
nad openAt this point you should have an Xcode project open up which you can build and run.
You can then run hello.js or greeter.js with the node app open in Xcode and debug through the C++ code.