gitfault
Debug the line, not just the stack.
gitfault enriches Node and TypeScript runtime errors with the author, commit, source window, and recent history behind the line that failed.
npm install gitfaultstderr · enriched
Error: checkout failed
at /repo/src/orders.ts:42
Blame
Jane Doe · a1b2c3d · fix checkout race
Source
39 | validate(order);
40 |
> 42 | throw new Error("checkout failed");
Recent commits
a1b2c3d fix checkout race
9f8e7d6 add order validation
Overview
The context your stack trace leaves out.
A stack trace tells you where an error surfaced. gitfault adds the local git history and source context that help explain why that line exists and what changed around it.
Use the enrichment pipeline directly, attach global handlers, or add the same middleware to Express and Fastify. Every lookup is best effort and never replaces the original error.
Feature list
Useful evidence, attached to the error.
- 01
Git blame at the throw site
See the author, commit, and message tied to the line that failed.
- 02
Source context
Print a focused window of code around the error instead of hunting through the file.
- 03
Recent file history
Surface the latest commits for the affected file alongside the stack trace.
- 04
Global error handlers
Attach once to enrich uncaught exceptions and unhandled rejections automatically.
- 05
Express & Fastify middleware
Use one observational handler that preserves and forwards the original error.
- 06
Terminal & Slack sinks
Write reports locally by default or opt in to rate-limited Slack delivery.
How it works
From thrown error to working theory.
- 01
Find the throw site
Parse the stack and choose the first useful application frame.
- 02
Read local context
Ask git and the filesystem for blame, recent commits, and nearby source.
- 03
Send it where you work
Format the enriched report for the terminal, Slack, or a custom sink.
Privacy details
Your error context stays yours.
gitfault is a local library, not an error-monitoring service. Its default terminal sink keeps runtime and repository context on the machine running your application.
Local by default
Errors, source snippets, blame data, and commit history are processed on the machine running your app.
No account or SaaS
gitfault has no hosted service, sign-up flow, telemetry account, or gitfault backend.
Slack is opt in
Data leaves the machine only when you configure a Slack webhook; reports are then sent to that webhook.
Zero runtime dependencies
The package uses Node built-ins and calls your local git binary directly.
Open source · MIT license
Inspect every line that touches your errors.
The parser, git lookups, source reader, formatters, middleware, and sinks are all available in the public repository.
View source on GitHubRuntime requirements
Node.js 18 or newer
A local git repository
The git binary available to the process
Give your next stack trace a history.
Install gitfault from npm and attach it in one call.