Hello World

Let’s build our first add-on. In keeping with tradition, this add-on will result in a Node module that will print out "Hello World!" Even though this is a very simple example, it typifies the structure of all further C++ add-ons you will build. This allows you to incrementally experiment with new commands and structures, growing your knowledge in easy-to-understand steps.

For the steps that follow to work, you'll need a C/C++ compiler and Python 2.7 installed on your system. The tools to build native code on an operating system are specific to that operating system (and provided by the community or corporation that maintains or owns it). Here are instructions for some of the major operating systems:

  • On macOS, for instance, Apple ...

Get Mastering Node.js - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.