Registry / web-framework / bund-cake

bund-cake

JSON →
library0.0.31jsnpmunverified

Bund-Cake is an early-stage JavaScript bundler and minifier specifically designed for integration with Express.js applications. It operates by taking multiple JavaScript source files and concatenating/minifying them into a single output file, which it then serves from a `/assets/bundle/` endpoint. The package, currently at version `0.0.31`, appears to be unmaintained or abandoned, with its public GitHub repository no longer accessible. This suggests no ongoing development, bug fixes, or security updates, and therefore no defined release cadence. Its primary differentiator was its direct integration within the Express application lifecycle, providing on-the-fly bundling capabilities rather than relying on a separate build step, making it suited for older, simpler Express projects that leverage server-side rendering with templating engines like EJS. Its usage of the `GLOBAL` object is indicative of older Node.js patterns.

npm install bund-cake
INSTALL
IMPORT
SIG · BUND-CAKE
B
bund-cake
web-frameworkjavascriptv0.0.31
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

bund
const bund = require('bund-cake')(app);
import bund from 'bund-cake'
Bund-Cake is designed for CommonJS environments and requires an Express `app` instance for initialization. It sets a `GLOBAL.bund` property by default, which is an anti-pattern.
bund.js
<%- bund.js('./path/to/script1.js', './path/to/script2.js') %>
This function is exposed via the initialized `bund` object (typically assigned to `GLOBAL.bund`) and is intended for use within EJS or similar templating engines to inject bundled script tags.

This quickstart demonstrates how to integrate `bund-cake` into a minimal Express.js application using EJS templates, bundling two sample JavaScript files and injecting them into the HTML output.

const express = require('express'); const path = require('path'); const app = express(); const port = 3000; // IMPORTANT: Bund-Cake uses GLOBAL.bund by default. // This is an outdated and generally discouraged practice. // In a real application, consider a wrapper or alternative. GLOBAL.bund = require('bund-cake')(app); // Set up EJS as the view engine app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'ejs'); // Serve static files (where your original JS files live) app.use(express.static(path.join(__dirname, 'public'))); // Create dummy JS files for bundling const fs = require('fs'); const publicDir = path.join(__dirname, 'public', 'javascripts'); if (!fs.existsSync(publicDir)) fs.mkdirSync(publicDir, { recursive: true }); fs.writeFileSync(path.join(publicDir, 'annoying-popups.js'), 'console.log("Annoying popup script loaded!"); alert("Hello from annoying popups!");'); fs.writeFileSync(path.join(publicDir, 'one-weird-tip.js'), 'console.log("One weird tip script loaded!"); document.getElementById("tip").innerText = "Drink more water!";'); // A simple route that renders a view with bundled JS app.get('/', (req, res) => { res.render('index'); }); app.listen(port, () => { console.log(`Server running at http://localhost:${port}`); console.log('Open your browser to http://localhost:3000 to see the bundled JS.'); }); /* // views/index.ejs <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Bund-Cake Example</title> </head> <body> <h1>Welcome to Bund-Cake Example</h1> <p>Bundled JavaScript will be injected below:</p> <div id="tip"></div> <%- bund.js('./public/javascripts/annoying-popups.js', './public/javascripts/one-weird-tip.js') %> </body> </html> */
Debug
Known issues
breakingThe `bund-cake` package is abandoned and its GitHub repository is inaccessible. There will be no further updates, bug fixes, security patches, or support for newer Node.js versions or JavaScript features. Using it in production is highly discouraged.
fix
Migrate to a modern, actively maintained bundler (e.g., Webpack, Rollup, Vite, esbuild) that supports contemporary JavaScript practices and build pipelines. Decouple bundling from the Express application lifecycle.
affects: >=0.0.31
gotchaBund-Cake relies on assigning its instance to the `GLOBAL.bund` object, which is an anti-pattern in modern Node.js development. This can lead to global variable pollution and potential conflicts with other modules or environments.
fix
If forced to use, ensure `GLOBAL.bund` is used consistently and does not conflict with other parts of your application. Ideally, avoid packages that modify global scope directly.
affects: >=0.0.1
gotchaThe package is tightly coupled with Express.js and older CommonJS modules. It does not support ES Modules (ESM) syntax (`import/export`) and will not work out of the box with modern JavaScript module systems.
fix
Use a contemporary bundler that supports both CommonJS and ESM, or rewrite modules to adhere to a consistent module system. Consider build-time bundling instead of runtime bundling for better performance and reliability.
affects: >=0.0.1
gotchaBund-Cake performs runtime bundling, which can introduce performance overhead on every request in development, and potentially in production if not cached correctly. Modern build systems typically bundle at deploy-time.
fix
Adopt a dedicated build step using tools like Webpack, Rollup, or Vite to pre-bundle assets before deployment, significantly improving application performance and reducing server load.
affects: >=0.0.1
Errors
Common errors & fixes
Cannot find module 'bund-cake'
The package has not been installed or is not resolvable in the current Node.js environment.
fix
Run `npm install bund-cake` in your project directory.
TypeError: Cannot read properties of undefined (reading 'js') OR bund is not defined
The `bund-cake` module was not correctly initialized with your Express app, or the `GLOBAL.bund` property was not set/is being overwritten.
fix
Ensure `GLOBAL.bund = require('bund-cake')(app)` is called early in your application setup (e.g., `app.js`) before any views attempt to use `bund.js`.
ReferenceError: app is not defined (when initializing bund-cake)
The `app` (Express application instance) variable was not in scope when `require('bund-cake')(app)` was called.
fix
Ensure `const app = express()` is called before `GLOBAL.bund = require('bund-cake')(app)` and `app` is properly passed.
Upgrade
Version history
0.0.31latest on npm
Audit
Dependencies
expressrequiredBund-Cake is initialized with an Express application instance, indicating a runtime dependency on Express for its core functionality.
Agent activity
3 hits · last 30 days
node
2
OpenAI (training)
1
Resources