Registry / web-framework / broadway

broadway

JSON →
library0.1.4jsnpmunverified

Broadway is a lightweight library designed for adding extensibility and hookable middleware customization to server applications. The current stable version is 4.1.0, though it was last published over eight years ago, indicating it is an abandoned project with no active release cadence. Its core differentiator is its minimal footprint and generic 'hook' mechanism, powered by the `understudy` library, which allows developers to inject custom logic into application lifecycle events and middleware chains. It is primarily intended for use with CommonJS modules and older Node.js environments (specifically requiring Node.js 8 or higher). While it demonstrates integration with frameworks like Express, it offers a foundational, unopinionated approach to modular application design through its `mixin` and `perform` capabilities.

npm install broadway
INSTALL
IMPORT
SIG · BROADWAY
B
broadway
web-frameworkjavascriptv0.1.4
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.

App
const App = require('broadway');
import App from 'broadway';
Broadway is a CommonJS-only library, primarily used with `require()`. Attempting to use ESM `import` will lead to runtime errors.
App instance methods (e.g., mixin, preboot, start)
app.mixin(express());
broadway.mixin(express());
Methods like `mixin`, `preboot`, `use`, `start`, `before`, and `perform` are instance methods of an `App` object, not static methods on the `broadway` module itself.

This quickstart demonstrates initializing a Broadway `App`, mixing in Express.js, registering a `preboot` hook, defining basic Express routes, and starting the HTTP server.

const express = require('express'); const App = require('broadway'); // Create a new base App instance, configuring it for an HTTP port. // Mix in Express functionality directly during instantiation. const app = new App({ http: 8080 }, express()); // Register a preboot hook to run logic before the application fully starts. app.preboot(function (appInstance, options, next) { console.log('Broadway application is starting up...'); // Simulate an async operation setTimeout(() => { console.log('Preboot hook finished.'); next(); }, 100); }); // Define a basic route using the mixed-in Express functionality. app.use((req, res, next) => { if (req.url === '/') { res.end('Hello from Broadway powered by Express!'); } else { next(); } }); app.use((req, res) => { res.writeHead(404, { 'Content-Type': 'text/plain' }); res.end('404 Not Found'); }); // Start the application and begin listening for HTTP requests. app.start(function (err) { if (err) { console.error('Error on startup: %s', err.message); return process.exit(1); } console.log('Listening over HTTP on port %s', this.given.http); }); // To run this, save as app.js and run `node app.js`. Make sure express is installed (`npm i express broadway`).
Debug
Known issues
breakingThe `broadway` package requires Node.js >= 8, which is an extremely old and End-of-Life (EOL) version of Node.js. Using this package with modern Node.js versions may lead to compatibility issues or security vulnerabilities due to its abandoned status and outdated dependencies.
fix
Consider migrating to a modern, actively maintained application framework or extensibility library. If forced to use Broadway, ensure thorough testing in your specific Node.js environment and be aware of potential security risks.
affects: >=4.0.0
gotchaBroadway is an abandoned project, with no updates in over eight years. This means there will be no future bug fixes, security patches, or feature enhancements. Dependencies may also be outdated and contain known vulnerabilities.
fix
Avoid using `broadway` for new projects. For existing projects, evaluate the risk of using unmaintained software and plan for migration to an actively supported alternative.
affects: >=4.1.0
gotchaThe package is published exclusively as a CommonJS module. It does not provide ESM (ECMAScript Module) exports, and attempting to `import` it will result in `ReferenceError: require is not defined` in ESM-only contexts or other import resolution errors.
fix
Always use `const App = require('broadway');` to import Broadway. If your project is ESM-first, you might need to use a CommonJS wrapper or reconsider using this library.
affects: >=4.0.0
Errors
Common errors & fixes
ReferenceError: require is not defined
Attempting to import `broadway` using ESM syntax (`import App from 'broadway';`) in a context where `require` is not globally available (e.g., in an ESM module without a compatibility layer).
fix
Ensure you are using CommonJS `require` syntax: `const App = require('broadway');`.
TypeError: App is not a constructor
This error can occur if you're trying to instantiate `broadway` directly (e.g., `new broadway()`) instead of the exported `App` class, or if the import failed.
fix
Confirm your import statement is `const App = require('broadway');` and you are instantiating it as `new App(...)`.
Error: Cannot find module 'broadway'
The `broadway` package has not been installed or is not accessible in the current project's `node_modules`.
fix
Run `npm install broadway` or `yarn add broadway` in your project directory.
Upgrade
Version history
0.1.4latest on npm
Audit
Dependencies
understudyrequiredProvides the generic hook mechanism for 'perform' and 'before' functions.
winstonrequiredUsed internally, likely for logging, though not explicitly shown in quickstart examples.
Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources
broadway — npm install broadway · libregistry