node-bundle

raw JSON →
1.0.999 verified Sat Apr 25 auth: no javascript

A fast bundler for CommonJS applications, version 1.0.999. No release cadence noted. Differentiators vs alternatives like webpack or esbuild: minimal configuration, focused solely on CommonJS (CJS) module bundles for Node.js environments. Not actively maintained based on README absence.

error Error: Cannot find module 'node-bundle'
cause Package not installed or incorrect import syntax.
fix
Run npm install node-bundle and use const bundle = require('node-bundle');
error TypeError: bundle is not a function
cause Incorrect import (e.g., used import instead of require, or got wrong export).
fix
Use correct CommonJS require: const bundle = require('node-bundle');
gotcha Only supports CommonJS modules, not ESM.
fix Ensure all source files use require/module.exports; do not use import/export.
gotcha Output is always a single file; does not support code splitting.
fix Use webpack or esbuild for code splitting.
gotcha No TypeScript support; treats .ts files as .js.
fix Compile TypeScript to JavaScript first, then bundle.
npm install node-bundle
yarn add node-bundle
pnpm add node-bundle

Shows basic usage of the bundle function with entry and output paths, and handling of promise result.

const bundle = require('node-bundle');
bundle({
  entry: './src/index.js',
  output: './dist/bundle.js'
}).then(result => {
  console.log('Bundled:', result.size);
}).catch(err => console.error(err));