Calling C++ from nodejs

This page summarizes the projects mentioned and recommended in the original post on /r/cpp_questions

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • gRPC

    The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)

  • You can do this by sending socket connections, or use a library like https://grpc.io/.

  • node-addon-api

    Module for using Node-API from C++

  • Did a little digging, napi is header file in an npm package that's supposed to help you build C++ addons, node_api is node's actual API. https://github.com/nodejs/node-addon-api you might have already been using this. The examples have enough code that it shouldn't be too bad to get started

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • node-addon-examples

    Node.js C++ addon examples from http://nodejs.org/docs/latest/api/addons.html

  • Yeah, that's the only place I found a napi.h file, so I think tutorials using that are assuming the node-addon-api? Anyways checking out examples like this, https://github.com/nodejs/node-addon-examples/blob/7ca7b6d03c1acb72fe292b4be468009534a20ff3/2_function_arguments/node-addon-api/addon.cc, it actually looks pretty easy to use to call C++ functions in node

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts