JS Bundler

1.2.4 · abandoned · verified Tue Apr 21

js-bundler is a command-line tool designed for bundling JavaScript and CoffeeScript files, along with their 'required' dependencies, into a single output file. Currently at version 1.2.4, it was last published over 7 years ago, indicating an abandoned status. It differentiates itself from more feature-rich bundlers like Browserify by explicitly *not* providing Node.js built-in module shims or source mapping, aiming for a lightweight profile. This makes it suitable primarily for client-side browser or 'neutral' packages that do not rely on Node.js-specific modules. Its release cadence is effectively non-existent, given its age. Modern alternatives like Vite, Rollup, esbuild, and Parcel offer significantly faster build times, better developer experience, and more comprehensive feature sets, including native ES module support and advanced optimizations like tree-shaking, which js-bundler lacks.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates basic bundling of a main JavaScript file and its required dependency into a single output, first to stdout and then to a file named `bundle.js`.

#!/bin/bash

# Ensure js-bundler is installed globally or linked
# npm install -g js-bundler

# Create a simple JavaScript file that requires another module
cat <<EOF > main.js
const dep = require('./dependency.js');
console.log('Main script running, dependency says: ' + dep.message);
EOF

cat <<EOF > dependency.js
exports.message = 'Hello from dependency!';
EOF

echo "\n--- Bundling main.js to stdout ---"
bundle main.js

echo "\n--- Bundling main.js to bundle.js ---"
bundle main.js > bundle.js

echo "\n--- Content of bundle.js ---"
cat bundle.js

view raw JSON →