https://github.com/krystianity/node-n-api-base
skeleton project for async Node.js N-API C++ native modules
https://github.com/krystianity/node-n-api-base
abi addon cpp gyp n-api native nodejs
Last synced: about 1 month ago
JSON representation
skeleton project for async Node.js N-API C++ native modules
- Host: GitHub
- URL: https://github.com/krystianity/node-n-api-base
- Owner: krystianity
- License: mit
- Created: 2017-10-02T20:50:05.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-02T22:52:13.000Z (over 7 years ago)
- Last Synced: 2025-01-21T02:41:39.241Z (3 months ago)
- Topics: abi, addon, cpp, gyp, n-api, native, nodejs
- Language: C++
- Size: 12.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# C++ ABI Node.js Addon Hello World
## Info
- a simple parameter hello world example
- a more complex async worker hello world example
- build in the new Node.js [N-API](https://nodejs.org/api/n-api.html) (ABI)
- using the C++ wrapper [node-addon-api](https://github.com/nodejs/node-addon-api)## Requires
- Node.js >= `8.6.0`
- yarn `npm i -g yarn`
- CPP compiler like gcc## Install & Run
- `yarn` # make sure that node-gyp installation succeeds
- `yarn configure` # prepares MAKE configuration
- `yarn build` # builds native addon to /build
- `yarn start` # runs Javascript that executes native addon's functions## Structure
- `/lib/*` javascript source
- `/src/*` C++ native addon source
- `./binding.gyp` describes addon configuration for node-gyp
- `./addon.js` uses bindings module to export native addon
- `./index.js` requires javascript version of addon and executes