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

my-bad

v1.3.1

Published

Beautiful dev-server error pages: HTML, ANSI and JSON from one sourcemapped report

Readme

my-bad

npm version npm downloads Github Actions Codecov

Beautiful dev-server error pages rendered to HTML, ANSI or JSON and live updated over SSE. ✨

my-bad turns an error into a JSON report with sourcemapped frames, source snippets, causes, a component trace, and request context. You can render the report as a full HTML page, as an overlay on an existing page, or as ANSI text for the terminal.

A live channel keeps open pages up to date. Pages swap in new errors and reload once an error is fixed. The channel also carries warnings, logs, and problems from tools such as type checkers and linters.

The same report in the terminal:

Install

my-bad requires Node.js 22.12 or later.

npm install my-bad

Use it with Vite

Add the plugin to your Vite config:

import { myBad } from 'my-bad/vite'
import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [
    myBad()
  ]
})

Compile errors now open in an overlay, with frames mapped through the Vite module graph. The overlay closes when the next update succeeds.

Add Vite DevTools

If you use Vite DevTools, myBad() adds a dock to it. You don't need to configure my-bad. Vite DevTools requires Vite 8.3 or later. Install @vitejs/devtools, then enable DevTools in the same config:

import { myBad } from 'my-bad/vite'
import { defineConfig } from 'vite'

export default defineConfig({
  devtools: true,
  plugins: [
    myBad()
  ]
})

The dock lists the open error, the warnings, and every problem set. Errors no longer take over the page while DevTools is running.

Use it in any dev server

In the error handler of your dev server, build a report and render it. In this example, error, req, and res come from your server:

import { createReport, renderAnsi, renderPage, serializeReport } from 'my-bad'

const cwd = process.cwd()
const report = await createReport(error, { cwd })

console.error(renderAnsi(report, { cwd }))

res.statusCode = 500
if (req.headers.accept?.includes('text/html')) {
  res.setHeader('content-type', 'text/html')
  res.end(renderPage(report, { cwd }))
}
else {
  res.setHeader('content-type', 'application/json')
  res.end(JSON.stringify(serializeReport(report, { cwd })))
}

To keep pages live, add the channel and the badge. The dev server guide walks through each step.

Show problems from other tools

Type checkers, linters, and audits can publish their current diagnostics as a problem set. Every page that renders the badge shows a count for each tool, and opens the problems beside the page:

import { ESLint } from 'eslint'
import { createProblemReport } from 'my-bad'

const results = await new ESLint().lintFiles(['src'])

channel.setProblems('eslint', results.flatMap(result => result.messages.map(message => createProblemReport({
  name: 'ESLint',
  message: message.message,
  code: message.ruleId ?? undefined,
  file: result.filePath,
  line: message.line,
  column: message.column,
  kind: message.severity === 2
    ? 'error'
    : 'warning',
}))), { label: 'ESLint' })

Next steps

💻 Development

git clone [email protected]:danielroe/my-bad.git
corepack enable

# run interactive tests
pnpm dev
# run accessibility audit (computed contrast, axe-core, target sizes, focus, motion, reflow)
pnpm test:a11y
# render screenshots of the ui
pnpm screenshot

# re-render the screenshots in assets/ (autofix.ci keeps these current)
pnpm assets
# experiment in the playground
pnpm play
pnpm play:vite

Credits

This was inspired by youch, which is a phenomenal error page generator, and I would highly recommend it!

License

Made with ❤️

Published under MIT License.