Skip to content

nodejs addon starter project with ESM import syntax for binding/interfacing to native C/C++ libraries & code

Notifications You must be signed in to change notification settings

anthumchris/nodejs-addon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo tests JavaScript/TypeScript nodejs addons/bindings to C/C++ libraries using:

  1. node-addon-api (Node-API) for Application Binary Interface (ABI) stability
  2. make/Makefile instead of node-gyp to be faster and lightweight with fewer dependencies installed
  3. --experimental-addon-modules to provide import syntax instead of require() syntax (ECMAScript Modules (ESM) / JavaScript modules vs CommonJS (CJS)

Developers

  1. Install nodejs (npm), make, watchexec, with your system's package manager, if needed
  2. Run npm install

Workflow tasks

Run tasks with either make [task] or npm run [task]; npm scripts mirror make targets

Examples from the Makefile:

make                # (make all)
make all            # builds project and runs tests
make dev            # developer mode, watches file changes and rebuilds/retests

make clean          # remove built files
make clean all      # clean and build/test
make build          # build without testing
make test           # test without building

# npm only
npm run npm-reset   # reset for "npm install" reinstallation tests

About

nodejs addon starter project with ESM import syntax for binding/interfacing to native C/C++ libraries & code

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published