Registry / web-framework / browserify-middleware

browserify-middleware

JSON →
library8.1.1jsnpmunverified

Express/Connect middleware for Browserify v2, currently at version 8.1.1. Provides sensible defaults: automatic source maps, file watching in development, minification, gzip, and etag caching in production. Supports serving individual files, directories of files, and npm package bundles with external dependencies for optimized caching. Allows use without Express except for directory serving. Last updated in 2013; depends on browserify >=2.x and uses uglify-js. Compared to alternatives like budo or watchify, it integrates directly as middleware for existing Express apps.

npm install browserify-middleware
INSTALL
IMPORT
SIG · BROWSERIFY-MIDDLEW
B
browserify-middleware
web-frameworkjavascriptv8.1.1
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.

default
var browserify = require('browserify-middleware');
import browserify from 'browserify-middleware';
Package is CJS only, no ESM support.
browserify (as middleware)
app.get('/js/bundle.js', browserify('./client/file.js'));
app.get('/js/bundle.js', browserify.middleware('./client/file.js'));
The default export is the middleware function itself; no submodule.
browserify (array of packages)
browserify(['hyperquest', 'concat-stream'])
browserify('hyperquest', 'concat-stream')
Pass an array of module names, not separate arguments.

Sets up an Express server that serves a browserified version of client/main.js at /js/bundle.js.

var browserify = require('browserify-middleware'); var express = require('express'); var app = express(); app.get('/js/bundle.js', browserify(__dirname + '/client/main.js', { // options: external, noParse, cache, etc. })); app.listen(3000); console.log('Server running on port 3000');
Debug
Known issues
deprecatedPackage uses outdated browserify v2 API and may not work with newer Node.js versions.
fix
Consider migrating to modern bundler middleware like budo or webpack-dev-middleware.
affects: >=8.0
gotchaDirectory paths are relative to the calling module, not process.cwd().
fix
Use __dirname to construct absolute paths: browserify(__dirname + '/client/dir')
affects: *
gotchaWhen passing an array of npm packages, they are bundled into a single file exposing require, not separate entries.
fix
Use the array form only for shared dependencies; use .external option for external referencing.
affects: *
Errors
Common errors & fixes
Cannot find module 'browserify'
browserify is not installed as a peer dependency.
fix
npm install browserify --save
browserify is not a function
Incorrect import: trying to use named export instead of default.
fix
Use: var browserify = require('browserify-middleware');
Uncaught Error: module 'xyz' not found
Passed separate arguments instead of array to browserify().
fix
browserify(['module-a', 'module-b']) not browserify('module-a', 'module-b')
Upgrade
Version history
8.1.1latest on npm
Audit
Dependencies
browserifyrequiredCore dependency for bundling JavaScript modules
uglify-jsrequiredMinification in production mode
Agent activity
27 hits · last 30 days
node
24
Amazon
1
OpenAI (training)
1
Resources
browserify-middleware — npm install browserify-middleware · libregistry