Skip to content

skeleton project for async Node.js N-API C++ native modules

License

Notifications You must be signed in to change notification settings

krystianity/node-n-api-base

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 (ABI)
  • using the C++ wrapper 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

About

skeleton project for async Node.js N-API C++ native modules

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published