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

@github/failbot

v1.1.1

Published

A Failbot client for JavaScript

Downloads

26,310

Readme

Failbot JS

A Failbotg client for JavaScript.

Installation

This package is published to npm as @github/failbot.

❯ npm install @github/failbot

Usage:

const {Failbot, HTTPBackend, LogBackend} = require('@github/failbot')

const failbot = new Failbot({
  app: 'my-cool-app',
  backends: [new HTTPBackend({haystackURL: process.env.HAYSTACK_URL}), new LogBackend({log: console.log.bind(console)})]
})

try {
  riskyThing()
} catch (error) {
  failbot.report(error, {
    extra: 'metadata',
    can: 'be',
    passed: 'as well'
  })
}

Report delivery

Failbot.report(error, metadata?, options?) returns one promise for each configured backend. Reporting is best effort by default, so delivery failures resolve to undefined. Configuration and payload preparation errors, including redaction errors, throw synchronously.

Set rejectOnError to reject with backend delivery errors:

await Promise.all(failbot.report(error, metadata, {rejectOnError: true}))

HTTPBackend treats fetch errors, timeouts, and non-2xx responses as delivery failures. Requests time out after 5 seconds by default. Set timeoutMs to configure the timeout:

const backend = new HTTPBackend({
  haystackURL: process.env.HAYSTACK_URL,
  timeoutMs: 1_000
})

Exception payloads

HTTP and log reports include a runtime-specific platform ("node" in Node.js and "javascript" in browsers) and a structured exception_detail by default. Stack frames from V8/Node/Chrome and Firefox/Safari are normalized to caller-first order for Failbotg. The legacy class, message, and string backtrace fields are also included for compatibility.

Consumers can override the default platform and exception_detail through metadata passed to report. The formatter continues to own the legacy error fields, timestamp, and JavaScript environment.

Generated structured exception fields redact the known credential patterns covered by Failbotg's global context filters, including URL basic-auth credentials, cookie values, sensitive key-value pairs, and GitHub tokens. This filtering intentionally preserves other exception content, such as email addresses and identifiers. Caller-provided exception_detail values are preserved verbatim by default, and legacy fields retain their existing values.

Application owners are responsible for keeping service-specific sensitive data out of exceptions. Configure a redact function when the application handles values that the default credential patterns cannot identify:

const failbot = new Failbot({
  app: 'my-cool-app',
  backends: [new HTTPBackend({haystackURL: process.env.HAYSTACK_URL})],
  redact(value) {
    return value.replace(/service-specific-sensitive-pattern/g, '[app redacted]')
  }
})

Built-in filtering runs on generated structured details. The custom function then runs on every JSON-serializable string in the outbound payload, including generated and caller-provided structured details, legacy fields, and metadata. It is not applied to sensitive_context. Use it for additional formats called out by GitHub's secure exception handling guidance, such as authorization and HMAC headers, JWTs, service credentials, and application-specific serialized data. The function must always return a string and must not throw. Add tests for application redaction rules, and record a metric or safe log entry when a rule matches so the underlying exception can be fixed.

Custom backend implementations receive the configured function as the third argument to report and must apply it before transporting exception data. The bundled HTTP and log backends do this automatically.

Exception metadata should use registered semantic conventions. Data that must be available in Splunk but must not reach Sentry can be placed in the Failbotg sensitive_context object:

failbot.report(error, {
  context: {'gh.example.repository.id': repositoryId},
  sensitive_context: {'gh.example.repository.path': repositoryPath}
})

Only use sensitive_context when retaining the value is necessary. Authentication data and other restricted content must be removed before reporting rather than sent through either context.

In order to attribute reported exceptions to service catalog services, the catalog_service tag is included in all exceptions reported via this library. Since all moda deployments have an OTEL_SERVICE_NAME environment variable, catalog_service is included in every failbot report payload as the value of OTEL_SERVICE_NAME.

You should not need to override this value but, if you do, you can pass catalogService to the Failbot constructor: const failbot = new Failbot({app: 'my-app', catalogService: 'my-catalog', backends: ...}). Be aware that overriding this value may make it impossible for your team to receive alerts related to high volumes of exceptions.