This repo tests JavaScript/TypeScript nodejs addons/bindings to C/C++ libraries using:
- node-addon-api (Node-API) for Application Binary Interface (ABI) stability
- make/Makefile instead of node-gyp to be faster and lightweight with fewer dependencies installed
--experimental-addon-modulesto provideimportsyntax instead ofrequire()syntax (ECMAScript Modules (ESM) / JavaScript modules vs CommonJS (CJS)
- Install
nodejs(npm),make,watchexec, with your system's package manager, if needed - Run
npm install
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