npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

express-bugblaster

v1.1.0

Published

A Express Js error debugging assistant with code inspection and prevents app from crashing.

Readme

Express BugBlaster

Node.js Express License: MIT

Express BugBlaster is a lightweight and powerful middleware for Node.js/Express applications designed to streamline error handling and debugging. It captures and analyzes errors, providing detailed stack traces and logging capabilities and prevents app from crashing.

Features

  • Dynamic Error Analysis: Automatically extracts error details from stack traces and source code.
  • Comprehensive Logging: Saves errors to a customizable JSON log file for later review.
  • Custom Responses: Define custom error responses with an onError callback.
  • Environment Awareness: Detailed error messages in development, concise responses in production.
  • Crash Protection: Keeps your Express app running even after uncaught exceptions.

Installation

  1. Install via npm:

    npm install express-bugblaster
  2. Install Dependencies:

    Ensure you have Node.js (v18+ recommended) and npm installed, then run:

    npm install

Usage

Basic Setup

Add BugBlaster as middleware to your Express app to catch and analyze errors:

const express = require('express');
const bugblaster = require('express-bugblaster');

const app = express();


// Example route that throws an error
app.get('/crash', (req, res) => {
  throw new Error('Test error!');
});

// Add BugBlaster middleware after routes
app.use(bugblaster({
    logToFile: true,
    logFilePath: './errors.json',
    defaultResponse: 'Oops, something went wrong!',
    channels: [{
        platform: 'teams',
        url: 'https://ms-team.com/teams',
    }]
}));

app.listen(3000, () => console.log('Server running on http://localhost:3000'));

Configuration Options

Customize BugBlaster with these options:

| Option | Type | Default | Description | |-------------------|------------|--------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | logToFile | boolean | true | Enable/disable logging to a file. | | logFilePath | string | ./bugblaster-logs.json | Path to the log file (relative to process cwd). | | defaultResponse | string | 'Something went wrong...' | Default message returned in error responses. | | onError | function | undefined | Custom error handler: (err, req, res) => {}. | | channels | array | undefined | supported channels: slack,teams and discord channels: [{platform: "teams", url: "teams webhook url"}, {platform: "slack", url: "slack webhook url"}, {platform: "discord", url: "slack webhook url"}]. |

Development

Running Tests

Ensure code quality with Jest:

npm test

This runs tests with coverage reporting.

Contributing

We welcome contributions to Express BugBlaster! Here's how you can contribute:

  1. Fork the Repository:

    • Fork the repository to your GitHub account.
  2. Clone the Repository:

    • Clone the forked repository to your local machine:
      git clone [https://github.com/salmanzafar949/express-bug-blaster.git](https://www.google.com/search?q=https://github.com/salmanzafar949/express-bug-blaster.git)
  3. Create a Branch:

    • Create a new branch for your feature or bug fix:
      git checkout -b feature/your-feature-name
      or
      git checkout -b fix/your-bug-fix-name
  4. Make Changes:

    • Make your changes, ensuring they adhere to the project's coding standards.
  5. Test Your Changes:

    • Run the tests to ensure your changes don't introduce any regressions:
      npm test
    • Add new tests if necessary.
  6. Commit Changes:

    • Commit your changes with a clear and descriptive commit message:
      git commit -m "Add your feature or fix your bug"
  7. Push Changes:

    • Push your changes to your forked repository:
      git push origin feature/your-feature-name
  8. Create a Pull Request:

    • Go to the original repository on GitHub.
    • Click on "New Pull Request."
    • Select your branch and create the pull request.
    • Provide a clear description of your changes.
  9. Code Review:

    • Your pull request will be reviewed by the maintainers.
    • Address any feedback and make necessary changes.
  10. Merge:

    • Once your pull request is approved, it will be merged into the main branch.

Guidelines:

  • Follow the existing coding style and conventions.
  • Write clear and concise commit messages.
  • Add tests for new features and bug fixes.
  • Update the documentation if needed.

Thank you for contributing to Express BugBlaster!

License

Express BugBlaster is released under the MIT License.