
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Browserify plugin to write failed build error messages to the output file
A browserify plugin that writes the error message of a failed build to the output file, rendering it in the browser.
watchify index.js -o bundle.js -p errorify
After adding the plugin to your browserify
instance, errorify
prevents bundle()
from emitting error
's. All errors are trapped, including: invalid syntax in the source, a missing dependency, a failed transform, etc. When the error message is written to the output file, it is written to the DOM in a <pre>
tag (or console.error
if we are not in a browser environment).
During development, it might look like this:
Only the bundle()
stream is rewritten. If you pass in a callback, it'll get the expected err
and body
arguments.
errorify
is meant to be used with something like watchify. It saves you a trip to the terminal to see why a build failed.
Keep in mind that since errors are no longer emitted, all builds appear "successful". Careful not to deploy broken code.
Note: Only tested with Browserify 9+
var browserify = require('browserify');
var errorify = require('errorify');
var b = browserify({ /*...*/ });
b.plugin(errorify, /* errorify options */);
replacer
(optional) is a function that takes an error as its first argument, and returns a string that will be used as the output bundle.After installing errorify
as a local devDependency, you can use the --plugin
or -p
option like so:
watchify index.js -o bundle.js -p errorify
The added <pre>
tag has the class name errorify
, so you can customize errors in your page like so:
body > .errorify {
color: red;
font-family: 'Consolas', monospace;
padding: 5px 10px;
}
MIT.
FAQs
Browserify plugin to write failed build error messages to the output file
The npm package errorify receives a total of 1,310 weekly downloads. As such, errorify popularity was classified as popular.
We found that errorify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.