Navigate:
All Reposnode-gyp
~$NODEGY0.0%

node-gyp: Node.js native addon build tool

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

LIVE RANKINGS • 06:53 AM • STEADY
OVERALL
#234
41
DEVELOPER TOOLS
#47
10
30 DAY RANKING TREND
ovr#234
·Devel#47
STARS
10.5K
FORKS
1.9K
DOWNLOADS
16.8M
7D STARS
+3
7D FORKS
0
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.1.0

Adds Visual Studio 2026 (18.x) support; no breaking changes or new requirements.

  • Use Visual Studio 2026 (18.x) when building native addons on Windows if available.
  • No action required; existing VS versions remain supported alongside the new toolchain.
vv12.0.0

Drops support for older Node.js versions to align with npm 11's engine range; updates gyp-next to v0.21.0 and bumps multiple core dependencies.

  • Verify your Node.js version meets npm 11's minimum requirement before upgrading (exact version not specified in notes).
  • Review builds for compatibility with gyp-next v0.21.0 and updated deps (env-paths 3.0, which 6.0, nopt 9.0).
vv11.5.0

Maintenance release updating gyp-next to v0.20.5 and adding Python 3.14 RC3 compatibility; no breaking changes or new requirements.

  • Update gyp-next to v0.20.5 for latest build system improvements and fixes.
  • Verify compatibility with Python 3.14 RC3 if upgrading Python environments.


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers