Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Node.js
  3. node-pre-gyp

node-pre-gyp

BSD-3-ClauseJavaScriptv2.0.3

A Node.js tool for publishing and installing C++ addons from pre-built binaries.

GitHubGitHub
1.1k stars272 forks0 contributors

What is node-pre-gyp?

@mapbox/node-pre-gyp is a Node.js tool that facilitates the distribution and installation of pre-compiled binary packages for native C++ addons. It solves the problem of requiring end-users to compile native modules from source by allowing developers to publish platform-specific binaries that can be downloaded directly during npm install. This significantly reduces installation time and avoids compilation errors on user machines.

Target Audience

Node.js module authors who create or maintain native C++ addons and want to provide a seamless installation experience for their users across different operating systems and Node versions.

Value Proposition

Developers choose node-pre-gyp because it automates the complex process of binary deployment, integrates easily with npm workflows, and supports both traditional builds and the newer ABI-stable Node-API. Its ability to fall back to source compilation ensures reliability, while its deep integration with CI services like Travis and Appveyor streamlines automated publishing.

Overview

Node.js tool for easy binary deployment of C++ addons

Use Cases

Best For

  • Distributing native Node.js modules without requiring users to have compilers installed
  • Automating binary builds and publications via CI/CD pipelines
  • Supporting multiple Node.js versions and platforms (Windows, macOS, Linux) with pre-built binaries
  • Creating Node-API (N-API) modules that need ABI-stable binary distribution
  • Hosting private or public binary packages on Amazon S3 or custom HTTPS endpoints
  • Simplifying the installation process for modules with complex C++ dependencies

Not Ideal For

  • Projects consisting solely of JavaScript/TypeScript code with no native C++ bindings
  • Teams with security policies that mandate compiling all dependencies from source to avoid external binaries
  • Modules targeting a single, controlled environment where cross-platform binary distribution adds unnecessary overhead
  • Developers who prefer using node-gyp directly for finer-grained control over the compilation process without binary hosting

Pros & Cons

Pros

Binary Deployment Automation

Provides built-in commands like 'package', 'publish', and 'info' that automate the packaging and uploading of pre-built binaries to services like S3, reducing manual steps for module authors.

Cross-Platform Support

Handles binaries for multiple operating systems and architectures, and integrates with Node-API for ABI-stable builds across Node.js versions, ensuring wide compatibility as detailed in the configuration sections.

Reliable Fallback Mechanism

Automatically falls back to compiling from source using node-gyp if a compatible binary isn't available, preventing installation failures and ensuring robustness.

CI/CD Integration

Includes comprehensive guides for automating builds and publications with Travis CI and Appveyor, including secure environment variable setup, streamlining continuous deployment.

Cons

Configuration Complexity

Requires extensive setup in package.json and binding.gyp, such as adding binary objects and custom build targets, which can be error-prone and daunting for new users.

S3-Centric Design

Key features like 'publish' and 'info' commands are optimized for Amazon S3, limiting functionality with alternative hosting options and forcing a dependency on AWS for full utility.

Migration Overhead

The deprecation of unscoped versions in favor of @mapbox/node-pre-gyp requires manual updates to dependencies and configurations, as noted in the 'Special note on previous package'.

Large AWS Dependency

Requires @aws-sdk/client-s3 as a devDependency for publishing, adding significant bundle size that may be overhead for projects not using S3 or with size constraints.

Frequently Asked Questions

Quick Stats

Stars1,148
Forks272
Contributors0
Open Issues173
Last commit7 days ago
CreatedSince 2013

Tags

#native-modules#node-api#ci-cd#nodejs#aws-s3#priority#cross-platform#node-gyp

Built With

J
JavaScript
N
Node.js

Included in

Node.js65.5k
Auto-fetched 6 hours ago

Related Projects

huskyhusky

Git hooks made easy 🐶 woof!

Stars35,004
Forks1,081
Last commit1 month ago
jsdomjsdom

A JavaScript implementation of various web standards, for use with Node.js

Stars21,564
Forks1,776
Last commit2 days ago
dotenvdotenv

Loads environment variables from .env for nodejs projects.

Stars20,405
Forks935
Last commit11 days ago
patch-packagepatch-package

Fix broken node modules instantly 🏃🏽‍♀️💨

Stars11,162
Forks321
Last commit7 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub