Page MenuHome GnuPG

Research Node.js Addons
Closed, ResolvedPublic

Description

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"

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.

Event Timeline

anthumchris created this task.
anthumchris created this object in space S1 Public.

Completed working base repository with developer workflows for watching files and rebuilding/retesting:
https://github.com/anthumchris/node-addon

Findings:

  1. node-gyp is unneeded; migrating to make results in 95% performance gains (for the simple base/test project)
  2. Cmake seemed to potentially add complexity and I decided to avoid it for now
  3. very funny/informative and validates any confusion from attempting to learn nodejs addons: https://www.youtube.com/watch?v=0rpN6cZeGS4