https://github.com/springmeyer/node-cxx-example
A modern (as of 2020) example of writing a node C++ module
https://github.com/springmeyer/node-cxx-example
Last synced: about 1 year ago
JSON representation
A modern (as of 2020) example of writing a node C++ module
- Host: GitHub
- URL: https://github.com/springmeyer/node-cxx-example
- Owner: springmeyer
- Created: 2019-12-11T22:01:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-04T00:45:51.000Z (over 6 years ago)
- Last Synced: 2025-03-26T14:12:13.108Z (over 1 year ago)
- Language: C++
- Size: 7.81 KB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# node-cxx-example
[](https://travis-ci.com/springmeyer/node-cxx-example)
This is a modern (as of 2020) example of a simple node C++ module (aka addon).
It is designed to be used as a template by those interested in having a relatively simple starting point for experiments and learning.
If you are looking to write a new production quality node module a better starting point would be https://github.com/mapbox/node-cpp-skel, because it contains more build and testing scaffolding to catch bugs you might write.
# Supports
- OS X
- Node >= 8
Linux support may be added in the future.
# Building
First install dependencies:
```
npm ci
```
Then, build or rebuild the C++ code with:
```bash
./compile-and-link.sh
```
Run `./compile-and-link.sh` every time you change anything in `module.cpp`.
# Testing
Run:
```bash
node test.js
```