{"id":14467,"library":"bpkg","title":"bpkg Node.js Bundler","description":"bpkg is a command-line bundler and build tool specifically designed for Node.js projects, with an emphasis on handling native Node.js modules. It differentiates itself by requiring zero external dependencies for its operation, aiming for auditability and simplicity. It provides functionality similar to Browserify but with a stronger focus on Node.js-specific patterns, such as inlining or collecting native C++ bindings. The current version is v0.9.2. However, the project is considered abandoned; its GitHub repository is archived and marked as read-only, indicating no further development, bug fixes, or security patches will be provided. While it supports ES modules, full browser compatibility, and includes Babel/TypeScript/Uglify-JS support out of the box, its unmaintained status means these features may not be up-to-date with modern standards or environments.","status":"abandoned","version":"0.9.2","language":"javascript","source_language":"en","source_url":"git://github.com/chjj/bpkg","tags":["javascript","bundle","bundler","package"],"install":[{"cmd":"npm install bpkg","lang":"bash","label":"npm"},{"cmd":"yarn add bpkg","lang":"bash","label":"yarn"},{"cmd":"pnpm add bpkg","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[],"quickstart":{"code":"npm install -g bpkg\n\n# Example: Bundle the 'bcrypto' package, including its native modules\nbpkg ./node_modules/bcrypto bcrypto_bundle.js\n\n# Now, bcrypto_bundle.js can be used as a standalone module:\n# const bcrypto = require('./bcrypto_bundle.js');\n# console.log(bcrypto.randomBytes(32));","lang":"bash","description":"Demonstrates how to globally install bpkg and then bundle the 'bcrypto' package, including its native C++ modules, into a single JavaScript file."},"warnings":[{"fix":"Consider using actively maintained alternatives for bundling, such as esbuild, Rollup, or Webpack, which provide current features, security updates, and community support.","message":"The bpkg project is no longer maintained and its GitHub repository is archived and read-only. It will not receive updates, bug fixes, or security patches, making it unsuitable for new projects or environments requiring ongoing support.","severity":"breaking","affected_versions":"<=0.9.2"},{"fix":"Verify compatibility with your project's target Node.js version and JavaScript features. Manual transformations via Babel or TypeScript might be required if bpkg's built-in support is insufficient, or use a modern bundler.","message":"As an unmaintained tool, bpkg may not correctly handle modern JavaScript syntax (e.g., newer ES module features, optional chaining, nullish coalescing) or new Node.js APIs without manual configuration or pre-processing, potentially leading to build failures or runtime errors.","severity":"gotcha","affected_versions":"<=0.9.2"},{"fix":"Thoroughly test bundled applications in all target environments, especially concerning native module loading and performance. Be aware of potential security implications of inlined binaries and review bundle contents carefully.","message":"bpkg's unique handling of native Node.js modules (inlining them as base64 or collecting separately) might introduce challenges with bundle size, security scanning tools, or module resolution in certain complex environments.","severity":"gotcha","affected_versions":"<=0.9.2"},{"fix":"Exercise extreme caution when integrating and ensure comprehensive testing. Expect that any encountered issues will likely require manual workarounds or switching to an alternative.","message":"The package is pre-1.0 (v0.9.2) and unmaintained. This implies that even prior to its abandonment, it lacked the stability guarantees typically associated with 1.0+ versions, and any existing bugs, quirks, or undocumented behaviors will not be addressed.","severity":"gotcha","affected_versions":"<=0.9.2"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Install bpkg globally using npm: `npm install -g bpkg`, or execute it directly using `npx bpkg <command>`.","cause":"The bpkg command-line tool is not installed globally or is not accessible in your system's PATH.","error":"bpkg: command not found"},{"fix":"Ensure the native module is correctly specified in your `package.json` and its location is accessible to bpkg. You might need to adjust bpkg's resolution options like `--collect-bindings` or `--ignore-bindings`, or manually ensure all native module dependencies are met.","cause":"bpkg failed to correctly resolve or inline a native Node.js module dependency during the bundling process, or the path was incorrect.","error":"Error: Cannot find module 'some-native-module.node'"},{"fix":"Try using bpkg's `--esm` or `--es2015` flags if applicable. If the issue persists, you may need to transpile your source code with a tool like Babel or TypeScript *before* feeding it to bpkg, or switch to a more actively maintained bundler that natively supports modern JavaScript.","cause":"bpkg's internal parser or transformers do not support the specific modern JavaScript syntax (e.g., ES modules, new language features) used in your source code by default.","error":"SyntaxError: Unexpected token 'export' (or similar for modern JavaScript features)"}],"ecosystem":"npm"}