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 🙏

© 2026 – Pkg Stats / Ryan Hefner

fault-frame

v1.0.2

Published

Beautiful JavaScript error overlay for server API errors

Downloads

43

Readme

FaultFrame

Frontend browser library for beautiful and convenient viewing of JSON error responses from server frameworks.

Automatically catches and displays errors from backend frameworks like Symfony, Laravel, and Express in a beautiful and user-friendly overlay.

npm version License: MIT

Features

  • Automatic error interception (Axios, Fetch)
  • Stack traces with file paths and line numbers
  • Request/response details
  • Toast notifications
  • Works with React, Vue, vanilla JS
  • Backend framework-specific parsers (Symfony, Laravel, Express)

Screenshots

Toast Notification

Error Overlay

Installation

npm install fault-frame
# or
yarn add fault-frame

Note: If using with axios, you need to install it separately.

Demo

Try Live Demo →

Quick Start

Axios (Automatic)

import axios from 'axios';
import { FaultFrame } from 'fault-frame';

// Initialize FaultFrame with your backend framework
FaultFrame.init({
  framework: 'symfony',  // or 'laravel', 'express'
  axiosInstance: axios,
  enabled: true,
});

// Now all Axios errors are automatically caught and displayed!

Fetch API (Wrapper)

import { FaultFrame, createFetchWithFaultFrame } from 'fault-frame';

// Initialize FaultFrame
FaultFrame.init({
  framework: 'symfony',
  enabled: true,
});

// Create fetch wrapper
const fetchWithErrors = createFetchWithFaultFrame(FaultFrame.getInstance());

// Use like normal fetch - errors are automatically caught!
async function loadUsers() {
  const response = await fetchWithErrors('/api/users');
  const data = await response.json();
  return data;
}

Configuration

Basic Configuration

FaultFrame.init({
  framework: 'symfony',        // Backend framework
  axiosInstance: axios,        // Axios instance (optional)
  enabled: true,               // Enable/disable (default: true)
  showToast: true,             // Show toast notifications (default: true)
  toastPosition: 'bottom-right', // Toast position (default: 'bottom-right')
  toastDuration: 5000,         // Toast duration in ms (default: 5000)
});

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | framework | 'symfony' \| 'laravel' \| 'express' | Required | Backend framework type | | axiosInstance | AxiosInstance | - | Axios instance for auto-interceptor | | enabled | boolean | true | Enable/disable error catching | | showToast | boolean | true | Show toast notifications | | autoInstallAxios | boolean | true | Auto-install axios interceptor | | captureGlobalErrors | boolean | false | Capture global JS errors | | onError | (error: ParsedError) => boolean \| void | - | Custom error filter | | handleOnlyStatusCodes | number[] | - | Only handle these status codes | | ignoreStatusCodes | number[] | - | Ignore these status codes | | toastPosition | 'top-left' \| 'top-right' \| 'bottom-left' \| 'bottom-right' | 'bottom-right' | Toast position | | toastDuration | number | 5000 | Toast duration (ms) | | maxStackLines | number | 20 | Max stack trace lines | | filterStackTrace | (line: StackFrame) => boolean | - | Filter stack trace | | stripPathPrefix | string | - | Strip path prefix when copying |

API Reference

| Method | Description | |--------|-------------| | FaultFrame.init(config) | Initialize library with config | | FaultFrame.getInstance() | Get current instance | | handleError(error) | Manually handle an error | | showOverlay(parsedError) | Show error overlay | | clearToasts() | Clear all toasts | | setEnabled(enabled) | Enable/disable error catching | | configure(config) | Update configuration | | destroy() | Cleanup instance | | createFetchWithFaultFrame(instance) | Create Fetch wrapper with error handling |

Supported Backend Frameworks

Symfony

Automatically parses Symfony error format:

{
  "type": "https://tools.ietf.org/html/rfc2616#section-10",
  "title": "An error occurred",
  "status": 500,
  "detail": "Warning: mkdir(): Permission denied",
  "class": "ErrorException",
  "trace": [
    {
      "namespace": "App\\Service",
      "short_class": "FileUploadService",
      "class": "App\\Service\\FileUploadService",
      "type": "->",
      "function": "uploadFile",
      "file": "/var/www/app/src/Service/FileUploadService.php",
      "line": 118
    }
  ]
}

Laravel

Parses Laravel error responses:

{
  "message": "The given data was invalid.",
  "exception": "Illuminate\\Validation\\ValidationException",
  "file": "/var/www/app/app/Http/Controllers/UserController.php",
  "line": 42,
  "trace": [...]
}

Express/Node.js

Parses Express error format:

{
  "error": "Internal Server Error",
  "message": "Something went wrong",
  "statusCode": 500,
  "stack": "Error: Something went wrong\n    at ..."
}

Generic Errors

FaultFrame automatically detects error messages from various field names:

  • error, message, errorMessage, error_message
  • errorText, error_text, msg, detail
  • description, reason, errorDescription

Works with simple error responses:

{
  "success": false,
  "error": "Message text or files are required"
}

Multiple Axios Instances

You can use FaultFrame with multiple Axios instances:

const api1 = axios.create({ baseURL: '/api/v1' });
const api2 = axios.create({ baseURL: '/api/v2' });

// First initialization
FaultFrame.init({
  framework: 'symfony',
  axiosInstance: api1,
});

// Second initialization - adds interceptor to api2
FaultFrame.init({
  framework: 'symfony',
  axiosInstance: api2,
});

// Both api1 and api2 now have interceptors installed!