Research and learn the official Node.js addons APIs for interfacing with native C/C++ libs. This provides Javascript/Typescript bindings to gnupgme.
- Node.js C++ addons — top-level introduction
- Node-API — the newer recommendation "Unless there is a need for direct access to functionality which is not exposed by Node-API" that provides Application Binary Interface (ABI) stability across major Node.js releases. This reduces refactoring overhead previously caused by lower-level implementations that used Native Abstractions for Node.js (NAN) and direct use of internal V8, libuv, and Node.js libraries.
- node-addon-api — "a more efficient way to write C++ code that calls Node-API"
- Node-API — the newer recommendation "Unless there is a need for direct access to functionality which is not exposed by Node-API" that provides Application Binary Interface (ABI) stability across major Node.js releases. This reduces refactoring overhead previously caused by lower-level implementations that used Native Abstractions for Node.js (NAN) and direct use of internal V8, libuv, and Node.js libraries.
Focus on using node-addon-api, starting with examples from The Node-API Resource.
Evaluate alternatives to node-gyp, such as CMake.js, node-pre-gyp, prebuild, prebuildify, etc. GYP is no longer supported by Google and also requires Python. CMake seems more in-line with gnupgme.