gh-error
v0.0.1
Published
Make them errors into github issues please
Readme
gh-error
Make github issues about your nodejs errors!
Installation
npm install gh-error
# or
pnpm add gh-error
# or
yarn add gh-errorUsage
Pretty shrimple, one could say.
import { ErrorHandler } from "gh-error";
const handler = new ErrorHandler({
ghPat: process.env.GH_PAT, // GitHub personal access token (required)
// Optional: auto-detected from git if not provided
repoOwner: "your-username",
repoName: "your-repo",
});
// Bind to process errors (uncaughtException, unhandledRejection)
handler.bindToErrors();
// Or handle errors manually
try {
throw new Error("Something went wrong!");
} catch (e) {
await handler.handleError(e);
}Environment Variables
Set your GitHub PAT in your environment:
GH_PAT=ghp_your_token_hereWhat It Does
When an error occurs, gh-error will:
- Create a GitHub issue with the error details and a Mermaid diagram
- If the same error occurs again, it comments on the existing issue
- If a closed issue matches the error, it reopens it
Issues are tagged with automated-error and bug labels.
