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

gateway-pulse

v1.0.0

Published

Monitors payment gateway uptime and sends notifications when they go down.

Readme

Gateway Pulse 💓

NPM Version License Build Status

gateway-pulse is a robust, heavily typed Node.js package designed to monitor the health and uptime of various payment gateways. It intelligently combines status page data with direct API pings, guards against transient failures, and alerts your team through multiple channels when issues arise.

Installation

npm install gateway-pulse

Quick Start

Create a simple monitor that checks Stripe every 30 seconds and logs to the console:

import { GatewayMonitor } from 'gateway-pulse';

const monitor = new GatewayMonitor({
  gateways: ['stripe'],
  interval: 30,
});

monitor.on('down', (event) => {
  console.log(`🚨 ${event.gateway} is DOWN!`);
});

monitor.on('up', (event) => {
  console.log(`✅ ${event.gateway} recovered.`);
});

monitor.start();

Supported Gateways

You can pass the following lowercase strings in the gateways array:

| Gateway | ID | | :-------- | :---------- | | Stripe | stripe | | PayPal | paypal | | Razorpay | razorpay | | Braintree | braintree | | Square | square | | Adyen | adyen |

Configuration

The GatewayMonitor accepts a MonitorConfig object upon initialization:

| Option | Type | Default | Description | | :------------------ | :---------------------------- | :------ | :-------------------------------------------------------------------- | | gateways | (string \| GatewayConfig)[] | [] | List of gateway IDs or custom gateway configurations. | | interval | number | 60 | Polling interval in seconds. | | timeout | number | 10000 | HTTP request timeout in milliseconds. | | failureThreshold | number | 3 | Consecutive failures before dispatching a down or degraded alert. | | recoveryThreshold | number | 2 | Consecutive successes before dispatching an up (recovery) alert. | | debug | boolean | false | Enables verbose internal logging. | | notify | NotifyConfig | {} | Settings for configuring notification integrations. |

Notification Channels

The library includes resilient notifiers to distribute alerts automatically:

| Channel | Config Needed | Description | | :-------- | :---------------------------- | :--------------------------------------------------------------- | | Console | (Always on) | ANSI-colored terminal logs. | | Slack | notify.slack.webhookUrl | Rich Block Kit messages delivered to a Slack channel. | | Webhook | notify.webhook.url | Sends standard JSON AlertEvent payloads. | | Email | notify.email | Beautiful HTML email tables delivered via SMTP (Nodemailer). | | PagerDuty | notify.pagerduty.routingKey | Triggers and resolves incidents in PagerDuty via the Events API. |

Events API

You can hook directly into the GatewayMonitor instance since it extends EventEmitter:

monitor.on('down', (event: AlertEvent) => {
  /* Gateway went down */
});
monitor.on('degraded', (event: AlertEvent) => {
  /* Gateway is experiencing partial outages or high latency */
});
monitor.on('up', (event: AlertEvent) => {
  /* Gateway recovered fully */
});
monitor.on('check', (result: CheckResult) => {
  /* Fired quietly on EVERY check */
});
monitor.on('error', (err: { gateway: string; error: Error }) => {
  /* Fired on execution or HTTP faults */
});

Custom Gateways

If your payment provider isn't supported out-of-the-box, or you want to track internal APIs, provide a GatewayConfig directly to the gateways array:

monitor = new GatewayMonitor({
  gateways: [
    'stripe',
    {
      name: 'my-api',
      pingUrl: 'https://api.myapp.com/ping',
      statusPageUrl: 'https://status.myapp.com/api/v2/status.json', // Required to be Atlassian Statuspage v2 format
      incidentUrl: 'https://status.myapp.com',
    },
  ],
});

TypeScript Support

gateway-pulse is written entirely in strict TypeScript. All types and interfaces (Option, GatewayConfig, CheckResult, AlertEvent) are exposed via:

import { AlertEvent, GatewayConfig, CheckResult } from 'gateway-pulse';

Contributing

  1. Fork the repo and create your feature branch.
  2. Ensure you have Node.js installed.
  3. Run npm install, then execute the test suite npm test.
  4. Ensure 80% coverage and no lint errors.

License

MIT