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

js-debug-assistant

v1.0.1

Published

Explain JavaScript and Node.js errors in plain English, with solutions and suggested fixes.

Readme

js-debug-assistant

Explain JavaScript and Node.js runtime errors in plain English, with actionable solutions and suggested fixes. Use it as a library or from the command line to speed up debugging and help less experienced developers understand what went wrong.

Features

  • 100+ common error patterns for JavaScript, Node.js, browser, async, and network issues.
  • Plain‑language explanations for confusing runtime and syntax errors.
  • Concrete solution guidance and example fix snippets.
  • Stack trace awareness – shows file, line, and column when available.
  • Static file scanner to detect risky patterns before they throw.
  • Works as both Node.js library and CLI tool.

Installation

npm install js-debug-assistant

For global CLI usage:

npm install -g js-debug-assistant

Library usage

Basic example:

import explainError from 'js-debug-assistant';

try {
  console.log(user.name);
} catch (err) {
  console.log(explainError(err));
}

Sample output:

❌ Error
Cannot read properties of undefined (reading 'name')

📍 Location
src/app.js:23

💡 Explanation
You attempted to access a property on a value that is undefined.

🛠 Solution
Ensure the variable is defined before accessing its properties, or add a null/undefined check.

✨ Suggested Fix

if (user != null) {
  console.log(user.name);
}

Getting structured data instead of formatted text

import explainError, { explain } from 'js-debug-assistant';

try {
  doSomething();
} catch (err) {
  const structured = explain(err); // { name, message, category, explanation, solution, fix, location }
  console.log(structured.category);
}

Or:

const structured = explainError(err, { raw: true });

CLI usage

After installing globally:

js-debug-assistant "Cannot read properties of undefined (reading 'name')"

This prints a formatted explanation in your terminal.

Scan a file for risky patterns

js-debug-assistant scan app.js

Example output:

Static analysis for /path/to/app.js
----------------------------------------
Line 12: Property accessed in console.log without a preceding null/undefined check. (console.log(variable.property))
Line 34: Found await, but could not detect an enclosing async function. (await outside async)

Help and version

js-debug-assistant --help
js-debug-assistant --version

Example project demo

Once dependencies are installed, run:

npm run demo

This executes examples/demo.js, which intentionally triggers a common error and prints the explanation.


Contributing

Contributions are welcome! Error patterns evolve constantly and the database is designed to be easy to extend.

  • See CONTRIBUTING.md for details on:
    • Project setup.
    • Coding style and architecture.
    • How to add new error patterns or analyzers.

Please open an issue before submitting large changes so we can discuss direction and design.


License

MIT © Rahbar