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

human-readable-errors

v1.1.3

Published

A library to transform complex error messages into human-readable solutions.

Readme

Human-Readable-Errors

Effortlessly decode cryptic error messages into clear, actionable insights with human-readable-errors! Designed for developers, this library helps you identify the root causes of errors, suggests practical solutions, and even educates you on debugging strategies.


Features

Multi-Language & Framework Support

  • Languages:
    • JavaScript (General, Node.js, React)
    • Python (General, Django)
    • Java (General, Spring)
  • Automatically detects the programming language and framework based on the error message.

Smart Error Parsing

  • Analyzes error messages and stack traces to extract valuable debugging information.
  • Provides structured insights into the type, cause, and severity of errors.

Rich Database of Solutions

  • Extensive mappings of common errors with:
    • Detailed descriptions
    • Likely causes
    • Tested solutions
    • Example code snippets
    • Links to official documentation and resources

Row Error Handling

  • Unrecognized errors are automatically added as "rowErrors."
  • Row errors are indexed and incorporated into the main database within 24 hours.

Intelligent Matching

  • Utilizes string similarity algorithms to find the best match for your error.
  • Outputs a match score, reflecting the confidence level of the suggested solution.

Developer-Centric Design

  • Easily extendable to include new languages, frameworks, and error mappings.
  • Designed for scalability, maintainability, and performance.

Installation

Install the library via npm:

npm install human-readable-errors

Usage Examples

Basic Usage

const { handleError } = require("human-readable-errors");

const errorString = "TypeError: Cannot read property 'length' of undefined";

handleError(errorString)
  .then((errorDetails) => {
    console.log(errorDetails);
  })
  .catch((err) => {
    console.error(err);
  });

Pretty Printed Output

const { handlePrettyError } = require("human-readable-errors");

const errorString = "ReferenceError: x is not defined";

handlePrettyError(errorString)
  .then((prettyError) => {
    console.log(prettyError);
  })
  .catch((err) => {
    console.error(err);
  });

Initialization

You can initialize global error handling for browser or Node.js environments using:

const { initializeHumanReadableErrors } = require("human-readable-errors");

initializeHumanReadableErrors();

API Endpoints (if applicable)

1. Search Errors

Endpoint: POST /errors/search

Search for errors using fuzzy search capabilities.

Request Body:

{
  "query": "SyntaxError: Unexpected token"
}

Response Example:

[
  {
    "id": "12345",
    "language": "JavaScript",
    "type": "Error",
    "error": "SyntaxError: Unexpected token",
    "description": "An unexpected token is encountered during parsing.",
    "cause": ["Missing closing bracket", "Unescaped special character"],
    "solution": [
      "Check the syntax around the reported token",
      "Ensure special characters are properly escaped"
    ]
  }
]

Contribution

We welcome contributions to improve the library! Whether it's adding new error mappings, enhancing features, or fixing bugs, check out our CONTRIBUTING.md for guidelines.


License

This project is licensed under the MIT License. See the LICENSE file for details.


Feedback & Support

Have a question or suggestion? Feel free to:

  • Open an issue on GitHub.
  • Share your thoughts with the community!

Full API Example

const {
  handleError,
  handlePrettyError,
  initializeHumanReadableErrors,
  initializeNodeErrorHandler,
  initializeBrowserErrorHandler,
} = require("human-readable-errors");

// Initialize global error handling
initializeHumanReadableErrors();

// Handle an error and get detailed output
handleError("TypeError: Cannot read property 'foo' of undefined")
  .then((result) => {
    console.log(result);
  })
  .catch((error) => {
    console.error(error);
  });

// Pretty print error details
handlePrettyError("ReferenceError: bar is not defined")
  .then((formattedError) => {
    console.log(formattedError);
  })
  .catch((error) => {
    console.error(error);
  });