Navigate:
node-gyp
~$GYP0.1%

node-gyp: Node.js native addon build tool

Compiles native C/C++ addons for Node.js.

LIVE RANKINGS • 10:20 AM • STEADY
OVERALL
#330
13
DEVELOPER TOOLS
#67
1
30 DAY RANKING TREND
ovr#330
·Devel#67
STARS
10.5K
FORKS
1.9K
7D STARS
+16
7D FORKS
+3
See Repo:
Share:

Learn more about node-gyp

node-gyp is a cross-platform command-line tool that compiles native C and C++ addon modules for Node.js by wrapping the GYP build configuration system. It abstracts platform-specific compiler toolchains by generating appropriate build files for the target operating system, invoking Visual Studio build tools on Windows, make on Unix-like systems, and Xcode on macOS. The tool automatically detects and configures the correct Node.js headers and libraries needed for the native code to interface with the V8 JavaScript engine and Node.js APIs. It handles the complete build pipeline from parsing gyp configuration files through compiler invocation to producing dynamically loadable binary modules with platform-specific extensions. The architecture prioritizes compatibility across diverse development environments while managing the complexity of native compilation dependencies and toolchain variations.

node-gyp

1

Cross-platform build abstraction

Provides unified build commands that work on Unix, macOS, and Windows without requiring platform-specific configuration changes. Handles differences in compiler toolchains and build systems across operating systems.

2

Version-specific targeting

Supports building against different Node.js versions by automatically downloading and managing the appropriate development headers. Allows developers to compile addons for versions other than the currently installed Node.js runtime.

3

Vendored gyp implementation

Includes a self-contained copy of gyp-next rather than relying on external dependencies. This approach reduces setup complexity and ensures consistent build behavior across different development environments.


const gyp = require('node-gyp')();

// Build native addon programmatically
gyp.parseArgv(['rebuild']);
gyp.todo.forEach((command) => {
  gyp.commands[command.name](command.args, (err) => {
    if (err) console.error('Build failed:', err);
    else console.log('Build completed successfully');
  });
});

vv12.2.0

Node-gyp v12.2.0 includes package version logging, gyp-next updates, and various platform improvements.

  • Include built package version in error logs
  • Update gyp-next to v0.21.1
  • Fix CPU concurrency detection on some platforms
  • Python is no longer a valid npm config setting
  • Switch to URL instead of url.parse
vv12.1.0

Add support for Visual Studio 2026 (18.x).

  • Add support for Visual Studio 2026 (18.x)
vv12.0.0

Node-gyp v12.0.0 aligns with npm 11 node engine requirements and updates dependencies.

  • Align to npm 11 node engine range
  • Update gyp-next to v0.21.0
  • Bump env-paths from 2.2.1 to 3.0.0


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers