Node-ninja: Native Addon Build Tool

1.0.2 · abandoned · verified Sun Apr 19

Node-ninja is a cross-platform command-line utility for compiling Node.js native addon modules. It serves as a fork of node-gyp, bundling the gyp project used by the Chromium team, with the long-term, unfulfilled goal of transitioning to the Ninja build system. The tool aims to simplify the process of building native modules across different platforms and supports compiling for multiple Node.js ABI versions by downloading necessary development headers. The current stable version is 1.0.2. Its release cadence is effectively non-existent, as the last release is considerably old, targeting historical Node.js versions (e.g., 0.8, 0.9, 0.10, 1.0) and Python 2.7. Key differentiators from upstream node-gyp, at the time of its last development, included better support for projects with multiple gyp files and incremental builds for prebuilds. However, it is now largely superseded by the actively maintained `node-gyp` and appears to be an abandoned project.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates the typical command-line installation and usage flow for `node-ninja` to configure and build a native Node.js addon.

// This JavaScript snippet describes how to use the node-ninja CLI tool.
// node-ninja itself is not imported into JavaScript applications but executed from the terminal.

console.log("First, install node-ninja globally via npm:");
console.log("  npm install -g node-ninja");

console.log("\nOnce installed, navigate to your native addon project directory.");
console.log("For example, if your project is 'my-native-addon':");
console.log("  cd my-native-addon");

console.log("\nThen, configure your native addon project. This step generates build files (e.g., Makefiles):");
console.log("  node-ninja configure");

console.log("\nFinally, build your native addon. This compiles your C/C++ source code:");
console.log("  node-ninja build");

console.log("\nTo build for a specific Node.js target version (useful for prebuilds):");
console.log("  node-ninja rebuild --target=0.10.0");

console.log("\nEnsure you have system dependencies like Python 2.7 and a C/C++ toolchain installed.");

view raw JSON →